private static async Task<UserViewModel> GetFullAndPartialViewModelForUser(IDataContext context, UserFilter filter) { var modelBase = GetBaseModel(context); var model = new UserViewModel(modelBase) { PageIndex = filter.PageIndex ?? 1, PageSize = filter.PageSize ?? int.MaxValue, Configuration = context.ConfigurationSettings, User = await context.User.GetUser(filter), Programmes = context.Vehicle.ListProgrammes(new ProgrammeFilter()), Markets = await context.Market.ListAvailableMarkets() }; model.CarLines = model.Programmes.ListCarLines(); return model; }
private static async Task<UserViewModel> GetFullAndPartialViewModelForUsers(IDataContext context, UserFilter filter) { var baseModel = GetBaseModel(context); var model = new UserViewModel(baseModel) { PageIndex = filter.PageIndex ?? 1, PageSize = filter.PageSize ?? int.MaxValue, Configuration = context.ConfigurationSettings, Users = await context.User.ListUsers(filter) }; model.TotalPages = model.Users.TotalPages; model.TotalRecords = model.Users.TotalRecords; model.TotalDisplayRecords = model.Users.TotalDisplayRecords; return model; }