Click or drag to resize

ServerFactoryFindAllForUser Method

Find all master servers available for the specified user.

Namespace:  AskiaPortalCmn
Assembly:  AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax
public static IEnumerable<IServer> FindAllForUser(
	IContext context,
	IUser user,
	QueryAllFilter filter = QueryAllFilter.NotDeleted
)

Parameters

context
Type: AskiaPortalCmnIContext
Context of execution.
user
Type: AskiaPortalCmnIUser
User for who to find available servers.
filter (Optional)
Type: AskiaPortalCmn.CommonQueryAllFilter
Filter to apply on query.

Return Value

Type: IEnumerableIServer
Return an object to iterate through the list of servers.
Remarks
This method only returns the list of master servers.
Examples

Find all servers available for the specified user.

var context = ContextFactory.CreateByUserGuid(Guid.Parse("20BE5F84-F006-49A0-9674-4B16A090AF2D"));   
var contextValidation = context.Validate();
if (!contextValidation.Success)
{
    throw contextValidation.Exception;
}

var servers = ServerFactory.FindAllForUser(context, context.User);
foreach(IServer server in servers)
{
    Console.WriteLine($"Server Id={server.Id}: {server.Name}");
}
See Also