示例#1
0
 public StatConnecter(IConnectableStat <TIn, TOut> connection, IStat <TOut, TStat> stat)
 {
     this.connection     = connection;
     this.stat           = stat;
     connection.Added   += (_, item) => stat.Add(item);
     connection.Deleted += (_, item) => stat.Delete(item);
 }
示例#2
0
        public async Task <ActionResult <Stat> > DeleteStat(int id)
        {
            await _stat.Delete(id);

            await _log.CreateLog(HttpContext, User.FindFirst("UserName").Value);

            return(NoContent());
        }
示例#3
0
 private void DeleteFromGroup(IStat <TIn, TOut> groupStat, TIn item)
 {
     OnDeleted(groupStat.Value);
     groupStat.Delete(item);
     if (!groupStat.IsEmpty)
     {
         OnAdded(groupStat.Value);
     }
 }
示例#4
0
 protected void HandleEvents <TTarget, TResult>(IStat <TTarget, TResult> stat, params Event <TTarget>[] events)
 {
     foreach (var e in events)
     {
         if (e.IsAddEvent)
         {
             stat.Add(e.Value);
         }
         else
         {
             stat.Delete(e.Value);
         }
     }
 }
示例#5
0
 public void Delete(TIn item)
 {
     stat.Delete(item);
 }
示例#6
0
 public void Delete(int id)
 {
     statRepo.Delete(GetWorkerStat(id));
     WorkRepo.Delete(id);
 }