feat(lab-3): do lab-3

This commit is contained in:
2024-10-11 15:51:22 +04:00
parent d99c4b78a0
commit c5b14425b0
71 changed files with 1888 additions and 2421 deletions

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibraryDataModels.AbstractModels
{
public interface IAuthor : IId
{
string Name { get; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibraryDataModels.AbstractModels
{
public interface IBook : IId
{
string Name { get; }
string BookCover { get; }
string Author { get; }
string ReleaseDate { get; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibraryDataModels.AbstractModels
{
public interface IId
{
int Id { get; }
}
}

View File

@@ -0,0 +1,21 @@
using LibraryDataModels.AbstractModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibraryDataModels.Dtos
{
public class AuthorDto : IAuthor
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public AuthorDto() {}
public AuthorDto(IAuthor author)
{
Id = author.Id;
Name = author.Name;
}
}
}

View File

@@ -0,0 +1,27 @@
using LibraryDataModels.AbstractModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibraryDataModels.Dtos
{
public class BookDto : IBook
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string BookCover { get; set; } = string.Empty;
public string Author { get; set; } = string.Empty;
public string ReleaseDate { get; set; } = string.Empty;
public BookDto() {}
public BookDto(IBook book)
{
Id = book.Id;
Name = book.Name;
BookCover = book.BookCover;
Author = book.Author;
ReleaseDate = book.ReleaseDate;
}
}
}

View File

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,24 @@
using LibraryDataModels.AbstractModels;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibraryDataModels.Views
{
public class AuthorView : IAuthor
{
public int Id { get; set; } = -1;
[DisplayName("ФИО автора")]
public string Name { get; set; } = string.Empty;
public AuthorView() {}
public AuthorView(IAuthor author)
{
Id = author.Id;
Name = author.Name;
}
}
}

View File

@@ -0,0 +1,34 @@
using LibraryDataModels.AbstractModels;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibraryDataModels.Views
{
public class BookView : IBook
{
public int Id { get; set; } = -1;
[DisplayName("Название")]
public string Name { get; set; } = string.Empty;
public string BookCover { get; set; } = string.Empty;
[DisplayName("ФИО автора")]
public string Author { get; set; } = string.Empty;
[DisplayName("Дата издания")]
public string ReleaseDate { get; set; } = string.Empty;
public BookView() {}
public BookView(IBook book)
{
Id = book.Id;
Name = book.Name;
BookCover = book.BookCover;
Author = book.Author;
ReleaseDate = book.ReleaseDate;
}
}
}