Created
March 12, 2012 15:56
-
-
Save justintoth/2022955 to your computer and use it in GitHub Desktop.
UserView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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