Spaces:
Runtime error
Runtime error
Download TaskTrackingSystem.Shared/Models/Project/UpdateProjectDto.cs from Yuruyuruu/task-tracking-system: direct link, hf CLI and curl.
- Browser
- Download file 1.33 kB
-
https://huggingface.co/spaces/Yuruyuruu/task-tracking-system/resolve/main/TaskTrackingSystem.Shared/Models/Project/UpdateProjectDto.cs
- Command line
-
hf download hf://spaces/Yuruyuruu/task-tracking-system/TaskTrackingSystem.Shared/Models/Project/UpdateProjectDto.cs
-
curl -L -o UpdateProjectDto.cs https://huggingface.co/spaces/Yuruyuruu/task-tracking-system/resolve/main/TaskTrackingSystem.Shared/Models/Project/UpdateProjectDto.cs
1.33 kB
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel.DataAnnotations; | |
| namespace TaskTrackingSystem.Shared.Models.Project | |
| { | |
| public class UpdateProjectDto : IValidatableObject | |
| { | |
| [] | |
| public string Name { get; set; } = string.Empty; | |
| [] | |
| public string? NameMy { get; set; } | |
| [] | |
| public string? Description { get; set; } | |
| [] | |
| public string? DescriptionMy { get; set; } | |
| [] | |
| public DateTime StartDate { get; set; } | |
| [] | |
| public DateTime EndDate { get; set; } | |
| [] | |
| public int? BudgetedHours { get; set; } | |
| public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) | |
| { | |
| if (string.IsNullOrWhiteSpace(Name) && string.IsNullOrWhiteSpace(NameMy)) | |
| { | |
| yield return new ValidationResult("At least one project name is required.", new[] { nameof(Name), nameof(NameMy) }); | |
| } | |
| if (EndDate < StartDate) | |
| { | |
| yield return new ValidationResult( | |
| "End date cannot be before start date.", | |
| new[] { nameof(EndDate), nameof(StartDate) }); | |
| } | |
| } | |
| } | |
| } | |