Buecherwurm/Magazine.cs

42 lines
900 B
C#
Raw Normal View History

2020-04-28 09:20:42 +00:00
using System.Text.Json.Serialization;
2020-04-28 09:04:54 +00:00
namespace Bücherwurm
{
public class Magazine : IProduct
{
2020-04-28 09:20:42 +00:00
[JsonIgnore]
2020-04-28 09:04:54 +00:00
public int ProductId {get; set;}
2020-04-28 09:20:42 +00:00
[JsonIgnore]
2020-04-28 13:29:20 +00:00
public CategoryEnum Category {get; set;}
2020-04-28 09:04:54 +00:00
2020-04-28 09:20:42 +00:00
[JsonIgnore]
2020-04-28 09:04:54 +00:00
public int LendTime {get; set;}
2020-04-28 09:20:42 +00:00
[JsonPropertyName("Titel")]
2020-04-28 13:11:31 +00:00
public string Name {get; set;}
2020-04-28 09:20:42 +00:00
[JsonPropertyName("Auflage")]
public string Run {get; set;}
[JsonPropertyName("Gruppe")]
public string Audience {get; set;}
[JsonPropertyName("Sachgruppe")]
public string Topic {get; set;}
2020-04-28 09:04:54 +00:00
public void OverwriteNullId(int Id)
{
if (ProductId == 0)
{
ProductId = Id;
}
}
2020-04-28 09:20:42 +00:00
public Magazine()
{
2020-04-28 13:29:20 +00:00
Category = CategoryEnum.Magazine;
2020-04-28 09:20:42 +00:00
LendTime = 2;
}
2020-04-28 09:04:54 +00:00
}
}