пофиксил баг анотациями для монгодб

This commit is contained in:
Timourka 2024-05-07 22:36:27 +04:00
parent 07f6a73f21
commit a6f2dc683f

View File

@ -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; }
}