public static C.User ToClient(this G.User entity) { if (entity == null) { return(null); } return(new C.User(entity)); }
public User(G.User entity) { Id = entity.id; Login = entity.login; Email = entity.email; FirstName = entity.first_name; LastName = entity.last_name; Password = entity.password; Salt = entity.salt; Role = (entity.role == "SIMPLE_USER")? UserRole.SIMPLE_USER : (entity.role == "ADMIN")? UserRole.ADMIN : UserRole.NOT_ASSIGNED; }