I have a class Category with two a property name as string.
and have a other class that use this class.
Public Class Myclass
{
public virtual Category Category
{
get;
set;
}
}
I have a object of Myclass. I want set string value for Category Property of this object .
Myclass cls=new Myclass();
cls.Category=// a string value
How to set this ?
For example, if one of those string properties is “Name” then you just set it like this:
Note that the
Nameproperty must be accessible to the calling code (e.g.public).Or you can write it like this: