Spaces:
Running
Running
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel.DataAnnotations; | |
| using TaskTrackingSystem.Shared.Enums; | |
| using AppTaskStatus = TaskTrackingSystem.Shared.Enums.AppTaskStatus; | |
| namespace TaskTrackingSystem.Shared.Models.Task | |
| { | |
| public class CreateTaskDto : IValidatableObject | |
| { | |
| [] | |
| public string Title { get; set; } = string.Empty; | |
| [] | |
| public string? Description { get; set; } | |
| [] | |
| [] | |
| public long ProjectId { get; set; } | |
| [] | |
| public AppTaskStatus StatusId { get; set; } | |
| [] | |
| public TaskPriority PriorityId { get; set; } | |
| [] | |
| public long? AssignedTo { get; set; } | |
| [] | |
| public long? AssignedBy { get; set; } | |
| [] | |
| public DateTime DueDate { get; set; } | |
| public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) | |
| { | |
| if (DueDate == default) | |
| { | |
| yield return new ValidationResult( | |
| "Due date is required.", | |
| new[] { nameof(DueDate) }); | |
| } | |
| } | |
| } | |
| } | |