I am trying to implement my own profile class in C # that inherits from System.Web.Profile.ProfileBase. I have several properties of type System.Collections.Generic.List, which should be serialized as binary, and not by default. However, I'm not sure how to mark this option in the Profile class.
For example, I have a property called "SavedReports" that is of type List. If I used the web.config method, I would simply write:
<code>
<profile>
<providers>
<add name="SavedReports" serializeAs="Binary" type="System.Collections.Generic.List`1[MyNamespace.SavedReports]"/>
<code>
However, I'm not sure how to add the serializeAs = "Binary" attribute in C # for a custom implementation:
[SettingsAllowAnonymous(false)]
public List<SavedReport> SavedReports
{
get { return base["SavedReports"] as List<SavedReport>; }
set { base["SavedReport"] = value; }
}
code>
Any help would be great.
Thank you, Chris