locked
Self referencing POCO class (EFCodeFirst) RRS feed

  • Question

  • Im currently trying to make a Category class that has a ParentCategory or ParentID field to be able to create subcategories...

     

    i have this

    public class Categoria
      {
        [Key]public int CategoriaID { get; set; }
        public string Nombre { get; set; }
    
        public int? ParentID { get; set; }
        public virtual Categoria CategoriaPadre { get; set; }
      }
    

    BUT i want to use this with MvcScaffolding.. someone knows how to write this class in order to have a working relationship?? and that scaffolding can create the apropiate combobox for it in the forms?

     

    Sorry for my english :)

    • Moved by Jackie-Sun Monday, May 23, 2011 6:41 AM (From:ADO.NET Entity Framework and LINQ to Entities)
    Thursday, May 12, 2011 2:26 AM

All replies