Events-MVC (example with htmx)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Events.MVC.Models.Countries;
|
||||
|
||||
public class CountryTranslationViewModel
|
||||
{
|
||||
[Display(Name = "Language")]
|
||||
[StringLength(10)]
|
||||
public string LanguageCode { get; set; } = string.Empty;
|
||||
|
||||
[Display(Name = "Translation")]
|
||||
[StringLength(200)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
}
|
||||
27
Events-MVC/Events.MVC/Models/Countries/CountryViewModel.cs
Normal file
27
Events-MVC/Events.MVC/Models/Countries/CountryViewModel.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Sieve.Attributes;
|
||||
|
||||
namespace Events.MVC.Models.Countries;
|
||||
|
||||
public class CountryViewModel
|
||||
{
|
||||
[Display(Name = "Code")]
|
||||
[Required]
|
||||
[StringLength(3, MinimumLength = 2)]
|
||||
[Sieve(CanSort = true, CanFilter = true)]
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
[Display(Name = "Alpha-3")]
|
||||
[Required]
|
||||
[StringLength(3, MinimumLength = 3)]
|
||||
[Sieve(CanSort = true, CanFilter = true)]
|
||||
public string Alpha3 { get; set; } = string.Empty;
|
||||
|
||||
[Display(Name = "Name")]
|
||||
[Required]
|
||||
[StringLength(100)]
|
||||
[Sieve(CanSort = true, CanFilter = true)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public List<CountryTranslationViewModel> Translations { get; set; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user