Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 public void Add(T model, [CallerLineNumber] int lineNumber = 0, [CallerMemberName] string caller = null)
 {
     _cache?.Add(model.Id.ToString(), model);
     _db.Query(name).Insert(model);
 }