public void Update(CountingSoftwareUsers user) { var countingsoftwareusers = _context.CountingSoftwareUsers.Find(user.Id); if (countingsoftwareusers == null) { throw new AppException("User not found"); } // update user properties countingsoftwareusers.Password = user.Password; countingsoftwareusers.RoleId = user.RoleId; countingsoftwareusers.Username = user.Username; countingsoftwareusers.WilayatCode = user.WilayatCode; _context.CountingSoftwareUsers.Update(countingsoftwareusers); _context.SaveChanges(); }
public CountingSoftwareUsers Create(CountingSoftwareUsers user) { _context.CountingSoftwareUsers.Add(user); _context.SaveChanges(); return(user); }