Пример #1
0
        public static async Task <IEnumerable <Surveillance> > GetPossibleSurveillances(Team teamForLoggedInUser, Hit hit, IDependencyInjector di, IJsonStorage <LatestSurveillanceResult> surveilResultDb)
        {
            var surveilDb = di.GetInstance <ITableStorageDb <SurveilledItem> >();

            var result = new List <Surveillance>();
            var surveillanceActions = di.GetAllInstancesOf <ISurveillanceAction>();

            foreach (var isurveillance in surveillanceActions.Where(s => s.ApplicableForHit(hit)))
            {
                var s = await GetSurveillance(hit, isurveillance, teamForLoggedInUser, surveilDb, surveilResultDb);

                result.Add(s);
            }

            return(result);
        }
Пример #2
0
 public static List <SurveilledItem> GetAllSurveillanceItems(IDependencyInjector di)
 {
     return(GetAllSurveillanceItems(di.GetInstance <ITableStorageDb <SurveilledItem> >(), di.GetAllInstancesOf <ISurveillanceAction>()));
 }