Spaces:
Runtime error
Runtime error
Download TaskTrackingSystem.Shared/Models/Task/CreateTaskDto.cs from Yuruyuruu/task-tracking-system: direct link, hf CLI and curl.
- Browser
- Download file 1.72 kB
-
https://huggingface.co/spaces/Yuruyuruu/task-tracking-system/resolve/main/TaskTrackingSystem.Shared/Models/Task/CreateTaskDto.cs
- Command line
-
hf download hf://spaces/Yuruyuruu/task-tracking-system/TaskTrackingSystem.Shared/Models/Task/CreateTaskDto.cs
-
curl -L -o CreateTaskDto.cs https://huggingface.co/spaces/Yuruyuruu/task-tracking-system/resolve/main/TaskTrackingSystem.Shared/Models/Task/CreateTaskDto.cs
1.72 kB
| 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? TitleMy { get; set; } | |
| [] | |
| public string? Description { get; set; } | |
| [] | |
| public string? DescriptionMy { 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 (string.IsNullOrWhiteSpace(Title) && string.IsNullOrWhiteSpace(TitleMy)) | |
| { | |
| yield return new ValidationResult("At least one task title is required.", new[] { nameof(Title), nameof(TitleMy) }); | |
| } | |
| if (DueDate == default) | |
| { | |
| yield return new ValidationResult( | |
| "Due date is required.", | |
| new[] { nameof(DueDate) }); | |
| } | |
| } | |
| } | |
| } | |