コード例 #1
0
        public IHttpActionResult GetActivityPerUser(long id)
        {
            var mostActiveList = new List <MostActiveModel>();
            var analyses       = _analysisManager.ReadAnalysesForOrganisation(id);

            foreach (var analysis in analyses)
            {
                MostActiveModel mtemp = new MostActiveModel()
                {
                    User = analysis.CreatedBy,
                    NumberOfUserAnalyses = 1
                };
                if (mostActiveList.TrueForAll(p => p.User != mtemp.User))
                {
                    mostActiveList.Add(mtemp);
                }
                else
                {
                    mostActiveList[mostActiveList.FindIndex(p => p.User == mtemp.User)].NumberOfUserAnalyses++;
                }
            }
            return(Ok(mostActiveList));
        }
コード例 #2
0
 public IHttpActionResult GetAnalysesForOrganisation(long id)
 {
     return(Ok(_analysisManager.ReadAnalysesForOrganisation(id).ToList()));
 }