Click or drag to resize

SurveyFactoryFindAllForUser Method

Find all surveys available for the specified user.

Namespace:  AskiaPortalCmn
Assembly:  AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax
public static IEnumerable<ISurvey> 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 surveys.
filter (Optional)
Type: AskiaPortalCmn.CommonQueryAllFilter
Filter to apply on query.

Return Value

Type: IEnumerableISurvey
Return an object to iterate through the list of surveys.
Examples

Find all surveys 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 surveys = SurveyFactory.FindAllForUser(context, context.User);
foreach(ISurvey survey in surveys)
{
    Console.WriteLine($"Survey Id={survey.Id}: {survey.Name}");
}
See Also