/// <summary>
        /// Loading data for the creation page (get-method)
        /// </summary>
        /// <returns>View</returns>
        public IActionResult Create()
        {
            ViewData["GuestsId"] = new MultiSelectList(
                _userStorage.GetFullList()
                .Where(rec => rec.Email != User.Identity.Name)
                .ToList(),
                "Id",
                "Email");

            return(View());
        }
示例#2
0
        public List <UserViewModel> Read(UserBindingModel model)
        {
            if (model == null)
            {
                return(userStorage.GetFullList());
            }

            return(new List <UserViewModel> {
                userStorage.GetElement(model)
            });
        }
示例#3
0
 public List <UserViewModel> Read(UserBindingModel model)
 {
     if (model == null)
     {
         return(_userStorage.GetFullList());
     }
     if (model.Id.HasValue)
     {
         return(new List <UserViewModel> {
             _userStorage.GetElement(model)
         });
     }
     return(_userStorage.GetFilteredList(model));
 }