database changes

This commit is contained in:
2024-11-08 22:19:34 +01:00
Unverified
parent ba5d56e17c
commit 046dc26915
20 changed files with 3135 additions and 60 deletions

View File

@@ -6,7 +6,4 @@ public class Genre
{
[JsonPropertyName("name")]
public required string Name { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
}

View File

@@ -10,9 +10,6 @@ public class GenreQueryParameters : QueryParameters<GenreResponse>
[FromQuery(Name = "name")]
public string? Name { get; set; }
[FromQuery(Name = "description")]
public string? Description { get; set; }
#endregion
@@ -22,8 +19,6 @@ public class GenreQueryParameters : QueryParameters<GenreResponse>
protected override bool IsMeetingConditions(GenreResponse item) =>
(
TestStringWithRegex(item.Name, Name)
&&
TestStringWithRegex(item.Description, Description)
);
#endregion

View File

@@ -7,13 +7,11 @@ public class GenreRequest : Genre
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

@@ -12,8 +12,7 @@ public class GenreResponse : Genre, IQueryOrderable<GenreResponse>
public static IDictionary<string, Func<GenreResponse, IComparable>> OrderableProperties { get; } = new Dictionary<string, Func<GenreResponse, IComparable>>
{
{ "id", x => x.Id },
{ "name", x => x.Name },
{ "description", x => x.Description }
{ "name", x => x.Name }
};
@@ -34,7 +33,6 @@ public class GenreResponse : Genre, IQueryOrderable<GenreResponse>
{
Id = genre.Id;
Name = genre.Name;
Description = genre.Description;
}
#endregion