public void InsertCodeList(CodeList codeList) { if (codeList == null) { throw new ArgumentNullException("codeList"); } _context.CodeLists.AddObject(codeList); _context.SaveChanges(); }
public void UpdateCodeList(CodeList codeList) { if (codeList == null) { throw new ArgumentNullException("codeList"); } if (!_context.IsAttached(codeList)) { _context.CodeLists.Attach(codeList); } _context.SaveChanges(); }