public void Update(UserRoleHeader Header, List <UserRoleLine> LineItems) { _dbContext.Entry(Header).State = EntityState.Modified; foreach (var item in LineItems) { _dbContext.Entry(item).State = EntityState.Modified; } _dbContext.SaveChanges(); }
public void Add(UserRoleHeader Header, List <UserRoleLine> LineItems) { _dbContext.UserRoleHeader.Add(Header); foreach (var item in LineItems) { item.RoleHeader = Header; _dbContext.Add(item); } _dbContext.SaveChanges(); }