littleshop/DTOs/CategoryDto.cs
2025-08-20 13:20:19 +01:00

34 lines
777 B
C#

using System.ComponentModel.DataAnnotations;
namespace LittleShop.DTOs;
public class CategoryDto
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public DateTime CreatedAt { get; set; }
public bool IsActive { get; set; }
public int ProductCount { get; set; }
}
public class CreateCategoryDto
{
[Required]
[StringLength(100)]
public string Name { get; set; } = string.Empty;
[StringLength(500)]
public string? Description { get; set; }
}
public class UpdateCategoryDto
{
[StringLength(100)]
public string? Name { get; set; }
[StringLength(500)]
public string? Description { get; set; }
public bool? IsActive { get; set; }
}