You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
League-of-Legends_Project/EntityFramework_LoL/Sources/DTO/ChampionDTO.cs

74 lines
2.0 KiB

using Model;
using Shared;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using static System.Net.Mime.MediaTypeNames;
namespace DTO
{
public class ChampionDTO
{
public string Name { get; set; }
public string Bio { get; set; }
public string Icon { get; set; }
public ChampionClass Class { get; set; }
}
/*public class ChampionFullDTO
{
*//*[Required(ErrorMessage = "Name is required")]
[StringLength(60, ErrorMessage = "Name can't be longer than 60 characters")]*//*
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("bio")]
public string Bio { get; set; }
public ChampionClass Class {get; set;}
public string Icon {get; set;}
public ReadOnlyDictionary<string, int> Characteristics { get; set; }
public ImageDTO LargeImage { get; set; }
public IEnumerable<SkinDto> skins { get; set; }
public IEnumerable<Skill> skills { get; set; }
public ChampionFullDTO()
{
Characteristics = new ReadOnlyDictionary<string, int>(new Dictionary<string, int>());
}
}
*/
public class ChampionFullDTO
{
[JsonPropertyName("characteristics")]
public ReadOnlyDictionary<string, int> Characteristics { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("bio")]
public string Bio { get; set; }
[JsonPropertyName("class")]
public ChampionClass Class { get; set; }
[JsonPropertyName("icon")]
public string Icon { get; set; }
[JsonPropertyName("largeImage")]
public ImageDTO LargeImage { get; set; }
[JsonPropertyName("skins")]
public IEnumerable<SkinDto> Skins { get; set; }
[JsonPropertyName("skills")]
public IEnumerable<Skill> Skills { get; set; }
}
}