Spaces:
Runtime error
Runtime error
Download TaskTrackingSystem.Shared/Models/Role/CreateRoleDto.cs from Yuruyuruu/task-tracking-system: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/spaces/Yuruyuruu/task-tracking-system/resolve/main/TaskTrackingSystem.Shared/Models/Role/CreateRoleDto.cs
- Command line
-
hf download hf://spaces/Yuruyuruu/task-tracking-system/TaskTrackingSystem.Shared/Models/Role/CreateRoleDto.cs
-
curl -L -o CreateRoleDto.cs https://huggingface.co/spaces/Yuruyuruu/task-tracking-system/resolve/main/TaskTrackingSystem.Shared/Models/Role/CreateRoleDto.cs
1.05 kB
| using System.Collections.Generic; | |
| using System.ComponentModel.DataAnnotations; | |
| namespace TaskTrackingSystem.Shared.Models.Role | |
| { | |
| public class CreateRoleDto : IValidatableObject | |
| { | |
| [] | |
| public string Name { get; set; } = string.Empty; | |
| [] | |
| public string? NameMy { get; set; } | |
| [] | |
| public string? Description { get; set; } | |
| [] | |
| public string? DescriptionMy { get; set; } | |
| /// <summary> | |
| /// Optional: Menu and permission codes to assign to this role on creation. | |
| /// </summary> | |
| public List<string> AccessCodes { get; set; } = new(); | |
| public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) | |
| { | |
| if (string.IsNullOrWhiteSpace(Name) && string.IsNullOrWhiteSpace(NameMy)) | |
| { | |
| yield return new ValidationResult("At least one role name is required.", new[] { nameof(Name), nameof(NameMy) }); | |
| } | |
| } | |
| } | |
| } | |