Buecherwurm/Book.cs

62 lines
1.4 KiB
C#
Raw Normal View History

2020-04-27 09:26:45 +00:00
using System.Text.Json.Serialization;
2020-04-23 11:27:32 +00:00
namespace Bücherwurm
{
class Book
{
2020-04-27 09:26:45 +00:00
[JsonIgnoreAttribute]
public int BookId {get; set;}
2020-04-23 11:27:32 +00:00
2020-04-27 09:26:45 +00:00
[JsonPropertyName("title")]
2020-04-23 11:27:32 +00:00
public string Title {get; set;}
2020-04-27 09:26:45 +00:00
[JsonPropertyName("author")]
2020-04-23 11:27:32 +00:00
public string Author {get; set;}
2020-04-27 09:26:45 +00:00
[JsonPropertyName("country")]
2020-04-23 11:27:32 +00:00
public string Country {get; set;}
2020-04-27 09:26:45 +00:00
[JsonPropertyName("imageLink")]
2020-04-23 11:27:32 +00:00
public string ImageLink {get; set;}
2020-04-27 09:26:45 +00:00
[JsonPropertyName("link")]
2020-04-23 11:27:32 +00:00
public string Link {get; set;}
2020-04-27 09:26:45 +00:00
[JsonPropertyName("language")]
2020-04-23 11:27:32 +00:00
public string Language {get; set;}
2020-04-27 09:26:45 +00:00
[JsonPropertyName("pages")]
2020-04-23 11:27:32 +00:00
public int Pages {get; set;}
2020-04-27 09:26:45 +00:00
[JsonPropertyName("year")]
2020-04-23 11:27:32 +00:00
public int Year {get; set;}
public Book(int Id, string Title, string Author,
string Country, string ILink, string Link, string Language,
int Pages, int Year)
{
BookId = Id;
this.Title = Title;
this.Author = Author;
this.Country = Country;
ImageLink = ILink;
this.Link = Link;
this.Language = Language;
this.Pages = Pages;
this.Year = Year;
}
2020-04-27 09:26:45 +00:00
public Book()
{
}
public void OverwriteNullId(int Id)
{
if (BookId == 0)
{
BookId = Id;
}
}
2020-04-23 11:27:32 +00:00
}
}