Add contact controller

This commit is contained in:
Julian
2022-05-14 20:19:41 +02:00
parent df8be1672e
commit 9e38cfd25d
10 changed files with 212 additions and 16 deletions

14
Dtos/ContactDto.cs Normal file
View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
namespace weddingapi.Dtos
{
public record ContactDto
{
public Guid Id { get; init; }
public string From { get; init; }
public string Email { get; init; }
public string Message { get; init; }
public DateTimeOffset CreatedDate { get; set; }
}
}

15
Dtos/CreateContactDto.cs Normal file
View File

@@ -0,0 +1,15 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace weddingapi.Dtos
{
public record CreateContactDto
{
[Required]
public string From { get; init; }
[Required]
public string Email { get; init; }
[Required]
public string Message { get; init; }
}
}