public static TaskUserModel ToModel(UserEntity user) { return new TaskUserModel { UserId = user.Id, UserLogin = user.Login, }; }
public static TaskUserModel ToModel(UserEntity user, int progress) { return new TaskUserModel { UserId = user.Id, UserLogin = user.Login, Progress = progress }; }
public static TaskUserModel ToModel(TaskEntity task, UserEntity user) { return new TaskUserModel { UserId = user.Id, UserLogin = user.Login, TaskTitle = task.Title, TaskId = task.Id }; }
public Identity(UserEntity user) { if (user == null) { Login = "******"; return; } Id = user.Id; Login = user.Login; Email = user.Email; }
/// <summary> /// create new user /// </summary> /// <returns>null if user exist</returns> public static UserEntity CreateUser(string login, string email, string password) { IKeyService<UserEntity> users = (IKeyService<UserEntity>)System.Web.Mvc.DependencyResolver.Current.GetService(typeof(IKeyService<UserEntity>)); UserEntity membershipUser = null; if (null == FindUser(login, email)) { UserEntity user = new UserEntity() { Id = Guid.NewGuid(), Login = login, Email = email, Password = Crypto.HashPassword(password) }; users.Add(user); membershipUser = user; } return membershipUser; }