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); }
public async Task <ActionResult <Stat> > DeleteStat(int id) { await _stat.Delete(id); await _log.CreateLog(HttpContext, User.FindFirst("UserName").Value); return(NoContent()); }
private void DeleteFromGroup(IStat <TIn, TOut> groupStat, TIn item) { OnDeleted(groupStat.Value); groupStat.Delete(item); if (!groupStat.IsEmpty) { OnAdded(groupStat.Value); } }
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); } } }
public void Delete(TIn item) { stat.Delete(item); }
public void Delete(int id) { statRepo.Delete(GetWorkerStat(id)); WorkRepo.Delete(id); }