Пример #1
0
        public async Task <Product> RateProductAsync([GraphQLType(typeof(RateProductInputType))][GraphQLName("input")]
                                                     RateProductCommand input, [Service] ISheaftMediatr mediatr,
                                                     ProductsByIdBatchDataLoader productsDataLoader, CancellationToken token)
        {
            await ExecuteAsync(mediatr, input, token);

            return(await productsDataLoader.LoadAsync(input.ProductId, token));
        }
Пример #2
0
        public async Task <Product> CreateProductAsync(
            [GraphQLType(typeof(CreateProductInputType))][GraphQLName("input")]
            CreateProductCommand input, [Service] ISheaftMediatr mediatr,
            ProductsByIdBatchDataLoader productsDataLoader, CancellationToken token)
        {
            var result = await ExecuteAsync <CreateProductCommand, Guid>(mediatr, input, token);

            return(await productsDataLoader.LoadAsync(result, token));
        }