Db models
This commit is contained in:
parent
1408bee259
commit
6880715087
19
Database/Models/Cars.cs
Normal file
19
Database/Models/Cars.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Renis.Database.Models;
|
||||
|
||||
public class Cars
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
[Required]
|
||||
public string Number { get; set; } = null!;
|
||||
[Required]
|
||||
Polis Polis { get; set; } = null!;
|
||||
[Required]
|
||||
long PolisId { get; set; }
|
||||
[Required]
|
||||
User Resp { get; set; } = null!;
|
||||
[Required]
|
||||
long RespId { get; set; }
|
||||
}
|
11
Database/Models/Polis.cs
Normal file
11
Database/Models/Polis.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Renis.Database.Models;
|
||||
|
||||
public class Polis
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
[Required]
|
||||
public string Number { get; set; } = null!;
|
||||
}
|
16
Database/Models/User.cs
Normal file
16
Database/Models/User.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Renis.Database.Models;
|
||||
|
||||
public class User
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
[Required]
|
||||
public string Name { get; set; } = null!;
|
||||
[Phone]
|
||||
[Required]
|
||||
public string Phone { get; set; } = null!;
|
||||
[Required]
|
||||
public string Password { get; set; } = null!;
|
||||
}
|
16
Database/Models/UserPolis.cs
Normal file
16
Database/Models/UserPolis.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Renis.Database.Models;
|
||||
|
||||
public class UserPolis
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
[Required]
|
||||
public long UserId { get; set; }
|
||||
public User User { get; set; } = null!;
|
||||
[Required]
|
||||
public long PolisId { get; set; }
|
||||
public Polis Polis { get; set; } = null!;
|
||||
public bool IsOwner { get; set; }
|
||||
}
|
Loading…
Reference in New Issue
Block a user