public override List <EmployeeEvaluationDTO> ExecuteWithResult() { IRavenQueryable <EmployeeToEvaluate_Search.Projection> query = RavenSession .Query <EmployeeToEvaluate_Search.Projection, EmployeeToEvaluate_Search>(); if (Period != null) { query = query.Where(e => e.Period == Period); } var employeesProjection = query.ToList(); var mapper = new EmployeeEvaluationHelper(RavenSession, null); return(mapper.MapEmployeeEvaluation(employeesProjection)); }
public override List <EmployeeEvaluationDTO> ExecuteWithResult() { RavenQueryStatistics stats; IQueryable <EmployeeToEvaluate_Search.Projection> query = RavenSession .Query <EmployeeToEvaluate_Search.Projection, EmployeeToEvaluate_Search>() .Statistics(out stats) .Where(e => (e.Period == _period) && (e.UserName == _loggedUser || e.ResponsibleId == _loggedUser || e.Evaluators.Any(ev => ev == _loggedUser))); var employeesProjection = query.ToList(); var mapper = new EmployeeEvaluationHelper(RavenSession, _loggedUser); return(mapper.MapEmployeeEvaluation(employeesProjection)); }