Esempio n. 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);
 }
Esempio n. 2
0
        public async Task <ActionResult <Stat> > DeleteStat(int id)
        {
            await _stat.Delete(id);

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

            return(NoContent());
        }
Esempio n. 3
0
 private void DeleteFromGroup(IStat <TIn, TOut> groupStat, TIn item)
 {
     OnDeleted(groupStat.Value);
     groupStat.Delete(item);
     if (!groupStat.IsEmpty)
     {
         OnAdded(groupStat.Value);
     }
 }
Esempio n. 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);
         }
     }
 }
Esempio n. 5
0
 public void Delete(TIn item)
 {
     stat.Delete(item);
 }
Esempio n. 6
0
 public void Delete(int id)
 {
     statRepo.Delete(GetWorkerStat(id));
     WorkRepo.Delete(id);
 }