WebApi + ClientApp, GraphQL, Reflection

This commit is contained in:
Boris Milašinović
2026-05-06 20:55:05 +02:00
parent 8f7c704a90
commit 4fb3de19f6
196 changed files with 10395 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
using Sieve.Attributes;
namespace Events.WebAPI.Contract.DTOs;
public class EventDTO : IHasIdAsPK<int>
{
[Sieve(CanSort = true)]
public int Id { get; set; }
[Sieve(CanFilter = true, CanSort = true)]
public string Name { get; set; } = string.Empty;
[Sieve(CanFilter = true, CanSort = true)]
public DateOnly EventDate { get; set; }
[Sieve(CanSort = true)]
public int RegistrationsCount { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Events.WebAPI.Contract.DTOs;
public interface IHasIdAsPK<T> where T : IEquatable<T>
{
T Id { get; }
}

View File

@@ -0,0 +1,10 @@
namespace Events.WebAPI.Contract.DTOs;
public class IdName<T>
{
public T Id { get; set; } = default!;
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
}

View File

@@ -0,0 +1,13 @@
namespace Events.WebAPI.Contract.DTOs;
/// <summary>
/// Contains requested items (based on filter, paging and sorting criteria),
/// and the number of total items satisfying the filter
/// (or count of all items if no filter is present)
/// </summary>
/// <typeparam name="T"></typeparam>
public class Items<T>
{
public List<T>? Data { get; set; }
public int Count { get; set; }
}

View File

@@ -0,0 +1,52 @@
using Sieve.Attributes;
namespace Events.WebAPI.Contract.DTOs;
public class PersonDTO : IHasIdAsPK<int>
{
[Sieve(CanFilter = true, CanSort = true)]
public int Id { get; set; }
[Sieve(CanFilter = true, CanSort = true)]
public string FirstName { get; set; } = string.Empty;
[Sieve(CanFilter = true, CanSort = true)]
public string LastName { get; set; } = string.Empty;
[Sieve(CanFilter = true, CanSort = true)]
public string FirstNameTranscription { get; set; } = string.Empty;
[Sieve(CanFilter = true, CanSort = true)]
public string LastNameTranscription { get; set; } = string.Empty;
public string AddressLine { get; set; } = string.Empty;
public string PostalCode { get; set; } = string.Empty;
public string City { get; set; } = string.Empty;
public string AddressCountry { get; set; } = string.Empty;
[Sieve(CanFilter = true, CanSort = true)]
public string Email { get; set; } = string.Empty;
public string ContactPhone { get; set; } = string.Empty;
[Sieve(CanSort = true)]
public DateOnly BirthDate { get; set; }
[Sieve(CanFilter = true, CanSort = true)]
public string DocumentNumber { get; set; } = string.Empty;
[Sieve(CanFilter = true, CanSort = true)]
public string CountryCode { get; set; } = string.Empty;
[Sieve(CanFilter = true, CanSort = true)]
public string CountryName { get; set; } = string.Empty;
[Sieve(CanSort = true)]
public string FullNameTranscription { get; set; } = string.Empty;
[Sieve(CanSort = true)]
public int RegistrationsCount { get; set; }
}

View File

@@ -0,0 +1,42 @@
using Sieve.Attributes;
namespace Events.WebAPI.Contract.DTOs;
public class RegistrationDTO : IHasIdAsPK<int>
{
[Sieve(CanSort = true)]
public int Id { get; set; }
[Sieve(CanFilter = true, CanSort = true)]
public int EventId { get; set; }
[Sieve(CanFilter = true, CanSort = true)]
public int PersonId { get; set; }
[Sieve(CanFilter = true, CanSort = true)]
public int SportId { get; set; }
[Sieve(CanSort = true)]
public DateTime RegisteredAt { get; set; }
[Sieve(CanFilter = true, CanSort = true)]
public string PersonName { get; set; } = string.Empty;
[Sieve(CanFilter = true)]
public string PersonTranscription { get; set; } = string.Empty;
[Sieve(CanFilter = true, CanSort = true)]
public string PersonFirstNameTranscription { get; set; } = string.Empty;
[Sieve(CanFilter = true, CanSort = true)]
public string PersonLastNameTranscription { get; set; } = string.Empty;
[Sieve(CanFilter = true)]
public string CountryCode { get; set; } = string.Empty;
[Sieve(CanSort = true)]
public string CountryName { get; set; } = string.Empty;
[Sieve(CanFilter = true, CanSort = true)]
public string SportName { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,12 @@
using Sieve.Attributes;
namespace Events.WebAPI.Contract.DTOs;
public class SportDTO : IHasIdAsPK<int>
{
[Sieve(CanSort = true)]
public int Id { get; set; }
[Sieve(CanFilter = true, CanSort = true)]
public string Name { get; set; } = string.Empty;
}