Public/tool_debug_other/BuildTemplate/tmp/ApplicationService/FoodsQueryService.cs

(完整代码) 1KB

using Domain.Entities;
using Domain.Repository;
using IApplicationService;
using IApplicationService.GoodsService;
using IApplicationService.GoodsService.Dtos.Output;
using IApplicationService.GoodsService.Dtos.Input;
using Infrastructure.EfDataAccess;
using InfrastructureBase.AuthBase;
using InfrastructureBase.Object;
using Oxygen.Client.ServerProxyFactory.Interface;
using System.Threading.Tasks;
using IApplicationService.Base.AppQuery;
using System.Linq;
using InfrastructureBase.Data;
using Microsoft.EntityFrameworkCore;

namespace ApplicationService
{
    public class FoodsQueryService : IFoodsQueryService
    {
        private readonly EfDbContext dbContext;
        private readonly IStateManager stateManager;
        public FoodsQueryService(EfDbContext dbContext, IStateManager stateManager)
        {
            this.dbContext = dbContext;
            this.stateManager = stateManager;
        }
		
        [AuthenticationFilter]
        public async Task<ApiResult> GetFoodsList(PageQueryInputBase input)
        {
            var query = from Foods in dbContext.Foods select new GetFoodsListResponse() { };
            var (Data, Total) = await QueryServiceHelper.PageQuery(query, input.Page, input.Limit);
            return ApiResult.Ok(new PageQueryResonseBase<GetFoodsListResponse>(Data, Total));
        }
		
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。