public RelDistributionList AddRelDistributionList(RelDistributionList RelDistributionList) { using (_context = ConnectionHelper.CreateConnection()) { _context.RelDistributionLists.Add(RelDistributionList); _context.SaveChanges(); } return(RelDistributionList); }
public RelDistributionList UpdateRelDistributionList(RelDistributionList RelDistributionList) { using (_context = ConnectionHelper.CreateConnection()) { if (!_context.RelDistributionLists.Local.Any(r => r.RelDistributionListID == RelDistributionList.RelDistributionListID)) { _context.RelDistributionLists.Attach(RelDistributionList); } _context.Entry(RelDistributionList).State = EntityState.Modified; _context.SaveChanges(); } return(RelDistributionList); }