Files
hermes/WebApp/DTOs/EventCreateDto.cs
AleksDw 31f8cabeb0 Using to MinimalAPI
Usunalem EventApiController(dobry byl ale mial problemy).
Dodalem EventsEndpoints, zawiera async, używa Dtos (Data Transfer Objects).
Jeżeli chcecie zrobić HTTP request ale nie wiecie co dać w body JSONa to można sprawdzić w tych Dtos.
EventMapping służy do zmian obiektów Dto na Entity i odwrotnie.
2025-05-09 21:04:27 +02:00

16 lines
436 B
C#

using System.ComponentModel.DataAnnotations;
using WebApp.Entities;
namespace WebApp.DTOs;
// Input values in JSON file to create event
public record class EventCreateDto
(
[Required] int? OrganisationId,
[Required][StringLength(50)] string Title,
[StringLength(500)] string Description,
[Required][StringLength(100)] string Location,
[Required] DateTime? EventDate,
ICollection<EventSkill> EventSkills
);