From a6f2dc683f838fafd9f6c8d2de388b257b623ad0 Mon Sep 17 00:00:00 2001 From: Timourka Date: Tue, 7 May 2024 22:36:27 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D1=84=D0=B8=D0=BA=D1=81=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B1=D0=B0=D0=B3=20=D0=B0=D0=BD=D0=BE=D1=82=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D1=8F=D0=BC=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D0=BC?= =?UTF-8?q?=D0=BE=D0=BD=D0=B3=D0=BE=D0=B4=D0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SUBD_Car_rent/database/models.cs | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/SUBD_Car_rent/database/models.cs b/SUBD_Car_rent/database/models.cs index 9ee32cc..df97c73 100644 --- a/SUBD_Car_rent/database/models.cs +++ b/SUBD_Car_rent/database/models.cs @@ -1,10 +1,14 @@ -namespace database +using MongoDB.Bson.Serialization.Attributes; +using MongoDB.Bson; + +namespace database { // Определение моделей данных public class Car { - public int Id { get; set; } + [BsonRepresentation(BsonType.Int32)] + public int Id { get; set; } public int ModelId { get; set; } public int BranchId { get; set; } public int Year { get; set; } @@ -14,7 +18,8 @@ public class Client { - public int Id { get; set; } + [BsonRepresentation(BsonType.Int32)] + public int Id { get; set; } public string Name { get; set; } public string Surname { get; set; } public string Address { get; set; } @@ -24,7 +29,8 @@ public class Rental { - public int Id { get; set; } + [BsonRepresentation(BsonType.Int32)] + public int Id { get; set; } public int CarId { get; set; } public int ClientId { get; set; } public DateTime StartDate { get; set; } @@ -34,7 +40,8 @@ public class CarModel { - public int Id { get; set; } + [BsonRepresentation(BsonType.Int32)] + public int Id { get; set; } public string Brand { get; set; } public string Model { get; set; } public int Year { get; set; } @@ -44,7 +51,8 @@ public class Branch { - public int Id { get; set; } + [BsonRepresentation(BsonType.Int32)] + public int Id { get; set; } public string Name { get; set; } public string Address { get; set; } public string Phone { get; set; } @@ -53,13 +61,15 @@ public class Status { - public int Id { get; set; } + [BsonRepresentation(BsonType.Int32)] + public int Id { get; set; } public string Title { get; set; } } public class BodyType { - public int Id { get; set; } + [BsonRepresentation(BsonType.Int32)] + public int Id { get; set; } public string Title { get; set; } }