How to use Fluent style syntactic sugar with c# property declaration
- by Thomas
i never use fluent style code before. so first time i tried to develop Fluent style with c# property declaration but getting error. can any one help me.
public class MailTemplate
{
string _MailBody = "";
public MailTemplate MailBody
{
get { return _MailBody; }
set { _MailBody = value ; }
}
string _Subject = "";
public MailTemplate Subject
{
get { return _Subject; }
set { _Subject = value; }
}
string _MailFrom = "";
public MailTemplate MailFrom
{
get { return _MailFrom; }
set { _MailFrom = value; }
}
}
please help me how could assign or initialize mail body and later also can read with same property name. i think proeprty can not be use in case of fluent style development. need some light here. thanks