public void Add(T model, [CallerLineNumber] int lineNumber = 0, [CallerMemberName] string caller = null) { Stopwatch watch = new Stopwatch(); try { watch.Start(); _cache?.Add(name + model.Id.ToString(), model); _dbSet.Add(model); watch.Stop(); Logging("Add modal", watch.ElapsedMilliseconds, lineNumber, caller, model); } catch (Exception ext) { // _cache?.CatcheDelete("Add Exeptions",model.Id.ToString(), model); watch.Stop(); ErrorLogging("Add Error", watch.ElapsedMilliseconds, model, ext, caller, lineNumber); } }
public void Add(T model, [CallerLineNumber] int lineNumber = 0, [CallerMemberName] string caller = null) { _cache?.Add(model.Id.ToString(), model); _db.Query(name).Insert(model); }