public async Task <QueryResult <TechnologicalProcess> > FindAsync(TechnologicalProcessesQuery technologicalProcessesQuery)
        {
            var orderBy = String.Join(", ", technologicalProcessesQuery.OrderBys.ToList());

            var technologicalProcesses = _context.TechnologicalProcesses.FromSqlRaw(
                "EXEC dbo.FindTechnologicalProcesses {0}, {1}, {2}, {3}, {4}",
                technologicalProcessesQuery.Page,
                technologicalProcessesQuery.ItemsPerPage,
                orderBy,
                technologicalProcessesQuery.Name,
                String.Join(',', technologicalProcessesQuery.UsedInProductionProcesses)
                );

            var totalCount = CallStaticFunc <int>("TotalCountFindTechnologicalProcesses", new List <SqlParameter>()
            {
                new SqlParameter("@name", technologicalProcessesQuery.Name),
                new SqlParameter("@usedInProductionProcesses", String.Join(',', technologicalProcessesQuery.UsedInProductionProcesses))
            });

            return(new QueryResult <TechnologicalProcess>()
            {
                TotalItems = totalCount,
                Items = technologicalProcesses.ToList(),
            });
        }
コード例 #2
0
 public async Task <QueryResult <TechnologicalProcess> > FindAsync(TechnologicalProcessesQuery query)
 {
     return(await _technologicalProcesses.FindAsync(query));
 }