project reorganized

This commit is contained in:
2024-04-27 22:36:16 +02:00
Unverified
parent fcca2119a5
commit 4b333878b8
233 changed files with 4916 additions and 11471 deletions

View File

@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace WatchIt.Common.Model.Genres;
public class Genre
{
[JsonPropertyName("name")]
public required string Name { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
}

View File

@@ -0,0 +1,29 @@
using Microsoft.AspNetCore.Mvc;
namespace WatchIt.Common.Model.Genres;
public class GenreQueryParameters : QueryParameters<GenreResponse>
{
#region PROPERTIES
[FromQuery(Name = "name")]
public string? Name { get; set; }
[FromQuery(Name = "description")]
public string? Description { get; set; }
#endregion
#region PUBLIC METHODS
public override bool IsMeetingConditions(GenreResponse item) =>
(
TestString(item.Name, Name)
&&
TestString(item.Description, Description)
);
#endregion
}

View File

@@ -0,0 +1,20 @@
namespace WatchIt.Common.Model.Genres;
public class GenreRequest : Genre
{
#region PUBLIC METHODS
public Database.Model.Common.Genre CreateGenre() => new Database.Model.Common.Genre
{
Name = Name,
Description = Description,
};
public void UpdateGenre(Database.Model.Common.Genre genre)
{
genre.Name = Name;
genre.Description = Description;
}
#endregion
}

View File

@@ -0,0 +1,28 @@
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
namespace WatchIt.Common.Model.Genres;
public class GenreResponse : Genre
{
#region PROPERTIES
[JsonPropertyName("id")]
public long Id { get; set; }
#endregion
#region CONSTRUCTORS
[SetsRequiredMembers]
public GenreResponse(Database.Model.Common.Genre genre)
{
Id = genre.Id;
Name = genre.Name;
Description = genre.Description;
}
#endregion
}