Spaces:
Runtime error
Runtime error
Download TaskTrackingSystem.Shared/Models/User/UpdateUserDto.cs from Yuruyuruu/task-tracking-system: direct link, hf CLI and curl.
- Browser
- Download file 1.65 kB
-
https://huggingface.co/spaces/Yuruyuruu/task-tracking-system/resolve/main/TaskTrackingSystem.Shared/Models/User/UpdateUserDto.cs
- Command line
-
hf download hf://spaces/Yuruyuruu/task-tracking-system/TaskTrackingSystem.Shared/Models/User/UpdateUserDto.cs
-
curl -L -o UpdateUserDto.cs https://huggingface.co/spaces/Yuruyuruu/task-tracking-system/resolve/main/TaskTrackingSystem.Shared/Models/User/UpdateUserDto.cs
1.65 kB
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel.DataAnnotations; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace TaskTrackingSystem.Shared.Models.User | |
| { | |
| public class UpdateUserDto : IValidatableObject | |
| { | |
| [] | |
| [] | |
| [] | |
| public string Username { get; set; } = string.Empty; | |
| [] | |
| public string FirstName { get; set; } = string.Empty; | |
| [] | |
| public string LastName { get; set; } = string.Empty; | |
| [] | |
| public string? FirstNameMy { get; set; } | |
| [] | |
| public string? LastNameMy { get; set; } | |
| [] | |
| public string? Phone { get; set; } | |
| [] | |
| public long RoleId { get; set; } | |
| public bool IsActive { get; set; } | |
| public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) | |
| { | |
| var englishComplete = !string.IsNullOrWhiteSpace(FirstName) && !string.IsNullOrWhiteSpace(LastName); | |
| var burmeseComplete = !string.IsNullOrWhiteSpace(FirstNameMy) && !string.IsNullOrWhiteSpace(LastNameMy); | |
| if (!englishComplete && !burmeseComplete) | |
| { | |
| yield return new ValidationResult("At least one complete name is required.", new[] { nameof(FirstName), nameof(LastName), nameof(FirstNameMy), nameof(LastNameMy) }); | |
| } | |
| } | |
| } | |
| } | |