mirror of
https://github.com/GCMatters/hermes.git
synced 2026-02-04 13:40:13 +01:00
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.
17 lines
498 B
C#
17 lines
498 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using WebApp.Entities;
|
|
|
|
namespace WebApp.DTOs;
|
|
|
|
// Output values in JSON file
|
|
public record class EventSummaryDto(
|
|
int EventId,
|
|
[Required] string Organisation,
|
|
[Required] [StringLength(50)] string Title,
|
|
[StringLength(500)] string Description,
|
|
[Required] [StringLength(100)] string Location,
|
|
[Required] DateTime? EventDate,
|
|
ICollection<EventSkill> EventSkills,
|
|
ICollection<EventRegistration> EventRegistrations
|
|
);
|