I'm starting in mobile development and I'm doing a category control system. Where I can multi-level categories.
My entity looks like this:
public int CategoriaId { get; set; }
public string Descricao { get; set; }
public int? CategoriaPaiId { get; set; }
public virtual Categoria CategoriaPai { get; set; }
public virtual ICollection<Categoria> CategoriasFilho { get; set; }
My question is when creating my ViewModel
I started programming and so far it's like this:
[Key]
public int CategoriaId { get; set; }
[Display(Name = "Categoria pai")]
public string CategoriaPaiId { get; set; }
[Display(Name = "Descrição da categoria")]
[Required(ErrorMessage = "Descrição obrigatória.")]
public string Descricao { get; set; }
[Display(Name = "Ativo")]
public bool Status { get; set; }
How can I complete this?