Skip to content

Instantly share code, notes, and snippets.

@justintoth
Created March 12, 2012 15:56
Show Gist options
  • Save justintoth/2022955 to your computer and use it in GitHub Desktop.
Save justintoth/2022955 to your computer and use it in GitHub Desktop.
UserView
public class UserView
{
public UserView()
{
}
public UserView(Models.Users.User.User user)
{
Id = user.Id;
FirstName = user.FirstName;
LastName = user.LastName;
Username = user.Username;
EmailAddress = user.EmailAddress;
RoleId = user.Role.Id;
RoleName = user.Role.Name;
CompanyId = user.Company.Id;
CompanyName = user.Company.CompanyName;
}
public int Id { get; set; }
public string Guid { get; set; }
public string Username { get; set; }
public string Alias { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string EmailAddress { get; set; }
public int RoleId { get; set; }
public string RoleName { get; set; }
public int CompanyId { get; set; }
public string CompanyName { get; set; }
public DateTime? LastLogin { get; set; }
public UserEnums.AccountStatus AccountStatus { get; set; }
public Guid? SessionGuid { get; set; }
public List<PeripheralView> Peripherals { get; set; }
public UserView SetPeripherals(List<Models.Users.Peripheral.Peripheral> peripherals)
{
Peripherals = (from p in peripherals
select new PeripheralView(p)).ToList();
return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment