Подкоректировал запрос

This commit is contained in:
Егор Пыжов 2024-12-15 02:49:07 +04:00
parent 34a074f709
commit 7a1b7fb72a
2 changed files with 4 additions and 2 deletions

View File

@ -10,8 +10,10 @@ public class Service
[DisplayName("Тип услуги")]
public ServiceType ServiceType { get; private set; }
[DisplayName("Описание")]
[DisplayName("Название услуги")]
public string ServiceName { get; private set; } = string.Empty;
[DisplayName("Описание")]
public string Description { get; private set; } = string.Empty;
public static Service CreateEntity(int id, ServiceType type, string name, string description)

View File

@ -36,7 +36,7 @@ public class OrderRepository : IOrderRepository
}
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
var querySelect = @$"
SELECT o.*, c.Name as CompanyName, os.serviceId, os.quantity, s.ServiceType as ServiceName
SELECT o.*, c.Name as CompanyName, os.serviceId, os.quantity, s.ServiceName as ServiceName
FROM Orders AS o
LEFT JOIN Companies c on c.Id = o.CompanyId
INNER JOIN Order_Service AS os ON o.id = os.orderId