fleshout backend
This commit is contained in:
13
backend/Controllers/UserRequests.cs
Normal file
13
backend/Controllers/UserRequests.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Backend.Controllers;
|
||||
|
||||
// Validation attributes must target the primary constructor parameters, not the
|
||||
// generated properties; MVC rejects record types with property-level metadata.
|
||||
public sealed record CreateUserRequest(
|
||||
[Required][EmailAddress] string Email,
|
||||
[Required][StringLength(100, MinimumLength = 1)] string DisplayName);
|
||||
|
||||
public sealed record UpdateUserRequest(
|
||||
[Required][EmailAddress] string Email,
|
||||
[Required][StringLength(100, MinimumLength = 1)] string DisplayName);
|
||||
Reference in New Issue
Block a user