예제 #1
0
 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();
 }
예제 #2
0
 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();
 }