public void DeleteCallLog(Guid id) { using (var ctx = new NovaAlertContext()) { var cl = new CallLogDb() { CallLogId = id }; ctx.CallLogDbs.Attach(cl); cl.DeletedDate = DateTime.Now; ctx.SaveChanges(); } }
public void SaveCallLog(CallLog en) { lock (syncRoot) { using (var ctx = new NovaAlertContext()) { var cl = ctx.CallLogDbs.Where(c => c.CallLogId == en.CallLogId).FirstOrDefault(); if (cl == null) { cl = new CallLogDb(); ctx.CallLogDbs.Add(cl); } Mapper.Map <CallLog, CallLogDb>(en, cl); ctx.SaveChanges(); } } }