public void CreateUser(string userName, string password, string email, string phone, string roleId) { Login login = new Login { Name = userName, Password = password, Email = email, Phone = phone, RoleId = roleId }; SaveUser(login); }
public void SaveUser(Login user) { if (user.Id == 0) context.Logins.Add(user); else context.Entry(user).State = EntityState.Modified; context.SaveChanges(); }