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.
This commit is contained in:
AleksDw
2025-05-09 21:04:27 +02:00
parent 99f2e17a12
commit 31f8cabeb0
10 changed files with 232 additions and 115 deletions

View File

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