ServerFactoryFindAllSlaves Method |
Find all slaves servers of the specified master server.
Namespace:
AskiaPortalCmn
Assembly:
AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax public static IEnumerable<IServer> FindAllSlaves(
IContext context,
IServer master,
QueryAllFilter filter = QueryAllFilter.NotDeleted
)
Public Shared Function FindAllSlaves (
context As IContext,
master As IServer,
Optional filter As QueryAllFilter = QueryAllFilter.NotDeleted
) As IEnumerable(Of IServer)
public:
static IEnumerable<IServer^>^ FindAllSlaves(
IContext^ context,
IServer^ master,
QueryAllFilter filter = QueryAllFilter::NotDeleted
)
Parameters
- context
- Type: AskiaPortalCmnIContext
Context of execution. - master
- Type: AskiaPortalCmnIServer
Master server for which to search slave servers. - filter (Optional)
- Type: AskiaPortalCmn.CommonQueryAllFilter
Filter to apply on query.
Return Value
Type:
IEnumerableIServerReturn an object to iterate through the list of servers.
Examples
Find all slaves servers of the specified master server.
var context = ContextFactory.CreateByUserGuid(Guid.Parse("20BE5F84-F006-49A0-9674-4B16A090AF2D"));
var contextValidation = context.Validate();
if (!contextValidation.Success)
{
throw contextValidation.Exception;
}
var master = ServerFactory.FindById(context, 1);
var servers = ServerFactory.FindAllSlaves(context, master);
foreach(IServer server in servers)
{
Console.WriteLine($"Server Id={server.Id}: {server.Name}");
}
See Also