コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }