using System; using System.Linq; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Web.Mvc; using VideoGameQuotes.Api; namespace VideoGameQuotes.Web.Models { public class UserModel { public User CurrentUser { get; set; } public User User { get; set; } } public class EditUserModel { [Required] public int Id { get; set; } public string Username { get; set; } [Required] public UserGroup Group { get; set; } public string IpAddress { get; set; } public IEnumerable GetGroupList(UserGroup selectedGroup) { return Enum.GetValues(typeof(UserGroup)) .Cast() .Select(group => new SelectListItem { Text = group.ToString(), Value = group.ToString()/*, Selected = group == selectedGroup*/ }); } } }