init
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Net;
|
||||
using Kreta.Naplo.Domain.V3.HaziFeladat;
|
||||
using Kreta.Naplo.Domain.V3.Utility;
|
||||
using Kreta.Naplo.Dto.V3.Csatolmany;
|
||||
using Kreta.Naplo.Dto.V3.Documentation;
|
||||
using Kreta.Naplo.Dto.V3.Interfaces;
|
||||
using static Kreta.Naplo.Dto.V3.Converter.ResponseModelConverter;
|
||||
|
||||
namespace Kreta.Naplo.Dto.V3.HaziFeladat
|
||||
{
|
||||
public class HaziFeladatResponseDto : IDtoDocumentation
|
||||
{
|
||||
private string _szoveg;
|
||||
|
||||
[Required, Description(DescriptionLookUp.Id)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required, Description(DescriptionLookUp.HaziFeladatSzoveg + "; decoded HTML-ként küldi a BE")]
|
||||
|
||||
public string Szoveg { get => WebUtility.HtmlDecode(_szoveg); set => _szoveg = value; }
|
||||
|
||||
[Required ,Description(DescriptionLookUp.HaziFeladatHatarido)]
|
||||
public DateTime? HataridoDatuma { get; set; }
|
||||
|
||||
[Required, Description(DescriptionLookUp.TantargyId)]
|
||||
public int TantargyId { get; set; }
|
||||
|
||||
[Required, Description(DescriptionLookUp.TantargyNev)]
|
||||
public string TantargyNev { get; set; }
|
||||
|
||||
[Description(DescriptionLookUp.HaziFeladathozRogzitettCsatolmanyok)]
|
||||
public IEnumerable<CsatolmanyResponseDto> Csatolmanyok { get; set; }
|
||||
|
||||
public DocumentationExampleDto Example => new DocumentationExampleDto("GetHaziFeladat", 43510);
|
||||
|
||||
public static implicit operator HaziFeladatResponseDto(HaziFeladatResponse model) => new HaziFeladatResponseDto
|
||||
{
|
||||
Id = model.Id,
|
||||
Szoveg = model.Szoveg,
|
||||
HataridoDatuma = model.HataridoDatuma?.ToIso8601Utc(),
|
||||
TantargyId = model.TantargyId,
|
||||
TantargyNev = model.TantargyNev,
|
||||
Csatolmanyok = ModelToDto(model.Csatolmanyok)
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user