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