feat: DTO draft
This commit is contained in:
parent
e69c498d9b
commit
0180973a37
@ -1,4 +1,4 @@
|
||||
using System.Data.SQLite;
|
||||
using System.Data;
|
||||
|
||||
namespace Database
|
||||
{
|
||||
|
||||
@ -7,4 +7,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SQLite" Version="3.13.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
14
src/Dto/Author.cs
Normal file
14
src/Dto/Author.cs
Normal file
@ -0,0 +1,14 @@
|
||||
namespace Database.Dto;
|
||||
|
||||
|
||||
public class CreateAuthorDto
|
||||
{
|
||||
public string Name;
|
||||
public string Surname;
|
||||
public DateTime DateOfBirth;
|
||||
}
|
||||
|
||||
public class AuthorDto : CreateAuthorDto
|
||||
{
|
||||
public int Id;
|
||||
}
|
||||
17
src/Dto/Book.cs
Normal file
17
src/Dto/Book.cs
Normal file
@ -0,0 +1,17 @@
|
||||
namespace Database.Dto;
|
||||
|
||||
public class CreateBookDto
|
||||
{
|
||||
|
||||
public string Name;
|
||||
public int YearOfRelease;
|
||||
public int Total;
|
||||
public AuthorDto Author;
|
||||
public Publisher Publisher;
|
||||
}
|
||||
|
||||
public class BookDto : CreateBookDto
|
||||
{
|
||||
public int Id;
|
||||
|
||||
}
|
||||
16
src/Dto/Borrow.cs
Normal file
16
src/Dto/Borrow.cs
Normal file
@ -0,0 +1,16 @@
|
||||
namespace Database.Dto;
|
||||
|
||||
|
||||
public class BorrowCreateDto
|
||||
{
|
||||
public DateTime DateOfBorrow;
|
||||
public DateTime DateOfReturn;
|
||||
public DateTime ReturnDue;
|
||||
public UserDto User;
|
||||
public BookDto Book;
|
||||
}
|
||||
|
||||
public class Borrow : BorrowCreateDto
|
||||
{
|
||||
public int Id;
|
||||
}
|
||||
14
src/Dto/Publisher.cs
Normal file
14
src/Dto/Publisher.cs
Normal file
@ -0,0 +1,14 @@
|
||||
namespace Database.Dto;
|
||||
|
||||
|
||||
public class CreatePublisherDto
|
||||
{
|
||||
public string Name;
|
||||
public string State;
|
||||
|
||||
}
|
||||
|
||||
public class Publisher : CreatePublisherDto
|
||||
{
|
||||
public int Id;
|
||||
}
|
||||
13
src/Dto/User.cs
Normal file
13
src/Dto/User.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace Database.Dto;
|
||||
|
||||
|
||||
public class UserCreateDto
|
||||
{
|
||||
public string Name;
|
||||
public string Surname;
|
||||
}
|
||||
|
||||
public class UserDto : UserCreateDto
|
||||
{
|
||||
public int Id;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user