init
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.Naplo.Domain.V3.OsztalyCsoport;
|
||||
using Swashbuckle.Examples;
|
||||
|
||||
namespace Kreta.Naplo.Dto.V3.OsztalyCsoport
|
||||
{
|
||||
public class OsztalyCsoportTanuloRequestDto : IExamplesProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Osztály/csoport id
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int OsztalyCsoportId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Dátum ha nincs megadva akkor a mai nap.
|
||||
/// </summary>
|
||||
public DateTime? Datum { get; set; }
|
||||
|
||||
public static implicit operator OsztalyCsoportTanuloRequest(OsztalyCsoportTanuloRequestDto dto) => new OsztalyCsoportTanuloRequest
|
||||
{
|
||||
OsztalyCsoportId = dto.OsztalyCsoportId,
|
||||
Datum = dto.Datum?.ToLocalTime()
|
||||
};
|
||||
|
||||
public object GetExamples() => new OsztalyCsoportTanuloRequestDto
|
||||
{
|
||||
OsztalyCsoportId = 130796,
|
||||
Datum = DateTime.Now
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user