PIbd-21 Valiulov I.A. LabWork04 #5
@ -3,7 +3,6 @@ using Dapper;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using Npgsql;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace CarpentryWorkshop.Repositories.Implementations;
|
||||
|
||||
|
@ -75,10 +75,6 @@ public class OrderRepository : IOrderRepository
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
//var querySelect = @"SELECT * FROM Orders";
|
||||
//var order = connection.Query<Order>(querySelect);
|
||||
//_logger.LogDebug("Полученные объекты: {json}", JsonConvert.SerializeObject(order));
|
||||
//return order;
|
||||
var querySelect = @"
|
||||
SELECT orders.*, products.id AS productid, products.name AS productname, op.count AS count
|
||||
FROM orders
|
||||
|
@ -3,7 +3,6 @@ using Dapper;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using Npgsql;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace CarpentryWorkshop.Repositories.Implementations;
|
||||
|
||||
@ -76,8 +75,6 @@ public class ProductRepository : IProductRepository
|
||||
try
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
//var querySelect = @"SELECT * FROM Products";
|
||||
//var product = connection.Query<Product>(querySelect);
|
||||
var querySelect = @"
|
||||
SELECT products.*, materials.id AS materialid, materials.name AS materialname, pm.count AS count
|
||||
FROM products
|
||||
@ -107,8 +104,6 @@ public class ProductRepository : IProductRepository
|
||||
fr.SetProductMaterial(x.Value);
|
||||
return fr;
|
||||
}).ToArray();
|
||||
|
||||
//return product;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user