Association references unmapped class: PAM.Subscriber.Models.StatusContactPart

Topics: Customizing Orchard
Jul 28, 2011 at 8:06 PM

Hi,

This is my model. I am going to create Master details hierarchy grid view

 

namespace PAM.Subscriber.Models
{
    public class StatusPartRecord : ContentPartRecord {
    public virtual string Name { get; set; }
    public virtual int StatusIndex { get; set; }
    public virtual string Address { get; set; }
    public virtual string Description { get; set; }
    public virtual string IndexD { get; set; }
    public virtual string ServicesName { get; set; }
    public virtual IList ContactList { get; set; }


  }

     public class StatusPart : ContentPart
     {

         public StatusPart()
         {
             Status = new List();
            
         }



         public readonly LazyField> _status = new LazyField>();

         public IList Status { get { return _status.Value; } set { _status.Value = value; } }




    [Required]
         public string Name
         {
             get { return Record.Name; }
             set { Record.Name = value; }
    }

    [Required]
    public int StatusIndex
    {
        get { return Record.StatusIndex; }
        set { Record.StatusIndex = value; }
    }


    [Required]
    public string Address
    {
        get { return Record.Address; }
        set { Record.Address = value; }
    }




    public string Description
    {
        get { return Record.Description; }
        set { Record.Description = value; }
    }


    public string IndexD
    {
        get { return Record.IndexD; }
        set { Record.IndexD = value; }
    }

 
    public string ServicesName
    {
        get { return Record.ServicesName; }
        set { Record.ServicesName = value; }
    }

    public IList ContactList 
    
    { get{return Record.ContactList ;}
      set{Record.ContactList= value ;} 
    }

   
  }

     public class StatusContactPartRecord : ContentPartRecord
     {
         public virtual int StatusPartRecord_Id { get; set; }
         public virtual string TelephoneNumber { get; set; }
         public virtual string ServicesName { get; set; }      


     }


     public class StatusContactPart : ContentPart
     {
         public readonly LazyField> _statuscontcat = new LazyField>();

         public IList StatusContact { get { return _statuscontcat.Value; } set { _statuscontcat.Value = value; } }

         public StatusContactPart()
         {
             StatusContact = new List();
            
         }

         [Required]
         public int StatusPartRecord_Id
         {
             get { return Record.StatusPartRecord_Id; }
             set { Record.StatusPartRecord_Id = value; }
         }


         [Required]
         public string TelephoneNumber
         {
             get { return Record.TelephoneNumber; }
             set { Record.TelephoneNumber = value; }
         }

        
         public string ServicesName
         {
             get { return Record.ServicesName; }
             set { Record.ServicesName = value; }
         }


     }

}

 

But i geting this error why?  Association references unmapped class: PAM.Subscriber.Models.StatusContactPart

 

I have physical database tables

SS_PAM_Subscriber_StatusPartRecord

SS_PAM_Subscriber_StatusContactPartRecord

 

Hhere is error

 

lakmal

 

Coordinator
Jul 29, 2011 at 1:07 AM

Your parts should be ContentPart<TheCorrespondingPartRecordType>. Then again, it may have been cut off from your code: apparently you didn't use the code block feature of the editor to paste your code in and it got butchered.