Beispiel #1
0
        public virtual void Delete(string id)
        {
            using (new TimeMonitor(GetPrefix(id)))
            {
                try
                {
                    LogWarning("Delete", id);
                    var task = Task.Run(async() => { await collection.DeleteEntityAsync(id); });
                    task.Wait();

                    if (typeof(T) != typeof(HistoryService))
                    {
                        ProcessHistory(HistoryType.Delete, id, "", this.GetContext().UserId);
                    }

                    if (this.GetContext().IsUseCache&& IsCacheReady())
                    {
                        cache.Remove(id);
                    }
                }
                catch (Exception ex)
                {
                    LogException(ex);
                    return;
                }
            }
        }
Beispiel #2
0
        public virtual void Delete(string id)
        {
            using (new TimeMonitor(GetPrefix(id)))
            {
                try
                {
                    LogWarning("Delete", id);
                    var task = Task.Run(async() => { await collection.DeleteEntityAsync(id); });
                    task.Wait();

                    if (IsCacheReady())
                    {
                        cache.Remove(id);
                    }
                }
                catch (Exception ex)
                {
                    LogException(ex);
                    return;
                }
            }
        }