reworking git structure
All checks were successful
Build and Push Docker Image / docker (push) Successful in 48s
All checks were successful
Build and Push Docker Image / docker (push) Successful in 48s
This commit is contained in:
35
Models/Author.cs
Normal file
35
Models/Author.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Example.Models
|
||||
{
|
||||
public class Author
|
||||
{
|
||||
public Author() {}
|
||||
|
||||
public Author(string firstName, string lastName, DateTime birthdate)
|
||||
{
|
||||
FirstName = firstName;
|
||||
LastName = lastName;
|
||||
Birthdate = birthdate;
|
||||
}
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(100)]
|
||||
[DisplayName("First name")]
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
[StringLength(100)]
|
||||
[DisplayName("Last name")]
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
|
||||
[DataType(DataType.Date)]
|
||||
[DisplayName("Birthdate")]
|
||||
public DateTime Birthdate { get; set; }
|
||||
|
||||
public ICollection<Review> Reviews { get; set; } = new List<Review>();
|
||||
}
|
||||
}
|
||||
21
Models/Book.cs
Normal file
21
Models/Book.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Example.Models
|
||||
{
|
||||
public class Book
|
||||
{
|
||||
public Book() {}
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(200)]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
[StringLength(1000)]
|
||||
public string Summary { get; set; } = string.Empty;
|
||||
|
||||
[DataType(DataType.Date)]
|
||||
public DateTime Published { get; set; }
|
||||
}
|
||||
}
|
||||
8
Models/ErrorViewModel.cs
Normal file
8
Models/ErrorViewModel.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Example.Models;
|
||||
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public string? RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
21
Models/Review.cs
Normal file
21
Models/Review.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Example.Models
|
||||
{
|
||||
public class Review
|
||||
{
|
||||
Review() {}
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
[Range(1, 5)]
|
||||
public int Stars { get; set; }
|
||||
|
||||
[StringLength(1000)]
|
||||
public string Text { get; set; } = string.Empty;
|
||||
|
||||
public int AuthorId { get; set; }
|
||||
|
||||
public Author? Author { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user