I’m using Mvc3 and NHibernate
I have a class called Activation code like following:
public virtual int LoginAccountId { get; set; }
protected virtual string ActivatedCode { get; set; }
protected virtual DateTime ActivationDate { get; set; }
I want to access this field in a controller lik
ActivationCode code=new ActivationCode();
code.ActivatedCode="abc";
but not able to get it. why?
The property is
protectedwhich means you can access it only from inside the class or inside one of it’s inheritances.}
You can change the properties from
protectedtopublicjust like withLoginAccountId.Read MSDN article about
protected:Update:
The
ActivationCodeclass should look like this: