I'm using Glass Mapper V4 with Sitecore 7.2 that is tied in with TDS. TDS is used to auto generate all of my Glass Mapper models. I've also created a number of partial classes to extend the Glass Mapper classes TDS has generated. So far so good.
I have a web form on the website that I want to take advantage of Glass Mapper caching. Here we can see what TDS has generated:
[SitecoreType(TemplateId=ISenior_Surf_Day_Survey_PageConstants.TemplateIdString)] //, Cachable = true
public partial class Senior_Surf_Day_Survey_Page : GlassBase, ISenior_Surf_Day_Survey_Page
{
You can see that //, Cachable = true is commented out by code generation.
Since I can't manually edit my TDS code generated file with all the Glass Mapper classes, I tried to add the cachable attribute to my manual extended partial class.
[SitecoreType(Cachable = true)]
public partial class Senior_Surf_Day_Survey_Page
{
However, this produces a compile error of:
Error CS0579 Duplicate 'SitecoreType' attribute
My question is, how can I go about adding the cachable attribute with code generated models?