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)); }
public IHttpActionResult GetAnalysesForOrganisation(long id) { return(Ok(_analysisManager.ReadAnalysesForOrganisation(id).ToList())); }