public async Task <bool> Create(SLAAlertFRTPhone SLAAlertFRTPhone) { SLAAlertFRTPhoneDAO SLAAlertFRTPhoneDAO = new SLAAlertFRTPhoneDAO(); SLAAlertFRTPhoneDAO.Id = SLAAlertFRTPhone.Id; SLAAlertFRTPhoneDAO.SLAAlertFRTId = SLAAlertFRTPhone.SLAAlertFRTId; SLAAlertFRTPhoneDAO.Phone = SLAAlertFRTPhone.Phone; SLAAlertFRTPhoneDAO.CreatedAt = StaticParams.DateTimeNow; SLAAlertFRTPhoneDAO.UpdatedAt = StaticParams.DateTimeNow; DataContext.SLAAlertFRTPhone.Add(SLAAlertFRTPhoneDAO); await DataContext.SaveChangesAsync(); SLAAlertFRTPhone.Id = SLAAlertFRTPhoneDAO.Id; await SaveReference(SLAAlertFRTPhone); return(true); }
public async Task <bool> BulkMerge(List <SLAAlertFRTPhone> SLAAlertFRTPhones) { List <SLAAlertFRTPhoneDAO> SLAAlertFRTPhoneDAOs = new List <SLAAlertFRTPhoneDAO>(); foreach (SLAAlertFRTPhone SLAAlertFRTPhone in SLAAlertFRTPhones) { SLAAlertFRTPhoneDAO SLAAlertFRTPhoneDAO = new SLAAlertFRTPhoneDAO(); SLAAlertFRTPhoneDAO.Id = SLAAlertFRTPhone.Id; SLAAlertFRTPhoneDAO.SLAAlertFRTId = SLAAlertFRTPhone.SLAAlertFRTId; SLAAlertFRTPhoneDAO.Phone = SLAAlertFRTPhone.Phone; SLAAlertFRTPhoneDAO.CreatedAt = StaticParams.DateTimeNow; SLAAlertFRTPhoneDAO.UpdatedAt = StaticParams.DateTimeNow; SLAAlertFRTPhoneDAOs.Add(SLAAlertFRTPhoneDAO); } await DataContext.BulkMergeAsync(SLAAlertFRTPhoneDAOs); return(true); }
public async Task <bool> Update(SLAAlertFRTPhone SLAAlertFRTPhone) { SLAAlertFRTPhoneDAO SLAAlertFRTPhoneDAO = DataContext.SLAAlertFRTPhone.Where(x => x.Id == SLAAlertFRTPhone.Id).FirstOrDefault(); if (SLAAlertFRTPhoneDAO == null) { return(false); } SLAAlertFRTPhoneDAO.Id = SLAAlertFRTPhone.Id; SLAAlertFRTPhoneDAO.SLAAlertFRTId = SLAAlertFRTPhone.SLAAlertFRTId; SLAAlertFRTPhoneDAO.Phone = SLAAlertFRTPhone.Phone; SLAAlertFRTPhoneDAO.UpdatedAt = StaticParams.DateTimeNow; await DataContext.SaveChangesAsync(); await SaveReference(SLAAlertFRTPhone); return(true); }