public async ValueTask <List <СategoryProduct> > GetСategoriesMoreThenXProducts(int amount) { var result = await connection.QueryAsync <СategoryProduct, int, СategoryProduct>( SpName.СategoryMoreThenXProducts, (c, cp) => { СategoryProduct category = c; category.CountProducts = cp; return(category); }, param : new { amount }, commandType : CommandType.StoredProcedure, splitOn : "CountProducts"); return(result.ToList()); }
public async ValueTask <List <СategoryProduct> > CategoriesMoreFiveProducts(ReportTypeEnum reportType) { try { var result = await connection.QueryAsync <СategoryProduct, int, СategoryProduct>( SpName.CategoriesMoreFiveProducts, (c, p) => { СategoryProduct category = c; category.CountProducts = p; return(category); }, commandType : CommandType.StoredProcedure); return(result.ToList()); } catch (InvalidOperationException ex) { throw ex; } }