public void Update(IPQuoteCustomModel iPQuoteCustomModel) { if (iPQuoteCustomModel == null) { //throw new ArgumentNullException(nameof(iPQuoteCustomModel)); } var ipQuoteCustomDB = AMDSystemsEntities.ip_quote_custom.Where(qc => qc.quote_custom_id == iPQuoteCustomModel.quote_custom_id).FirstOrDefault(); Mapper.Map(iPQuoteCustomModel, ipQuoteCustomDB); AMDSystemsEntities.SaveChanges(); }
public void Add(IPQuoteCustomModel iPQuoteCustomModel) { if (iPQuoteCustomModel == null) { //throw new ArgumentNullException(nameof(iPQuoteCustomModel)); } ip_quote_custom ipQuoteCustomDB = Mapper.Map(iPQuoteCustomModel, new ip_quote_custom()); AMDSystemsEntities.ip_quote_custom.Add(ipQuoteCustomDB); AMDSystemsEntities.SaveChanges(); }
public static ip_quote_custom Map(IPQuoteCustomModel iPQuoteCustomModel, ip_quote_custom ipQuoteCustomDB) { if (iPQuoteCustomModel == null) { //throw new ArgumentNullException(nameof(iPQuoteCustomModel)); } if (ipQuoteCustomDB == null) { //throw new ArgumentNullException(nameof(ipQuoteCustomDB)); } ipQuoteCustomDB.quote_id = iPQuoteCustomModel.quote_id; return(ipQuoteCustomDB); }