How to include custom dlls in auto generated models?
I am using Model Builders in AppData mode.
I get models autogenerated into App_Data/Models folder.
I am including a model in the project. The model uses Archetype and nuPickers packages so the properties look like this:
///<summary>
/// Colour palette
///</summary>
[ImplementPropertyType("colourPalette")]
public nuPickers.Picker ColourPalette
{
get { return this.GetPropertyValue<nuPickers.Picker>("colourPalette"); }
}
///<summary>
/// Colour palette custom
///</summary>
[ImplementPropertyType("colourPaletteCustom")]
public Archetype.Models.ArchetypeModel ColourPaletteCustom
{
get { return this.GetPropertyValue<Archetype.Models.ArchetypeModel>("colourPaletteCustom"); }
}
The problem is that Archetype nor nuPickers are not referenced in the model class so they generate an error on compiling. I cannot reference them manually because when the model will be re-generated they will disappear anyway.
How to tell the class to use these additional dlls?
Yes, I know i shouldn't use custom dlls in autogenerated classes. I said that.
The problem is I am using plugins and they appear in autogerenated class with my properties as you can see in my code example so the model class won't compile even if I extend it.
have you in general referenced the dlls in your project?
If yes then my suggestion would be to create a new partial class with the same name, remove the auto generated properties to your new custom class and use them there. This way models builder does not generate them as they are already present and you can use the plugins.
How to include custom dlls in auto generated models?
I am using Model Builders in AppData mode.
I get models autogenerated into App_Data/Models folder.
I am including a model in the project. The model uses Archetype and nuPickers packages so the properties look like this:
The problem is that Archetype nor nuPickers are not referenced in the model class so they generate an error on compiling. I cannot reference them manually because when the model will be re-generated they will disappear anyway.
How to tell the class to use these additional dlls?
Hi Manila
I think you shouldn't use custom dlls in the autogenerated classes, try to override this classes with custom references or use another instances.
Thanks,
Alex
Yes, I know i shouldn't use custom dlls in autogenerated classes. I said that.
The problem is I am using plugins and they appear in autogerenated class with my properties as you can see in my code example so the model class won't compile even if I extend it.
Hi Manila,
have you in general referenced the dlls in your project?
If yes then my suggestion would be to create a new partial class with the same name, remove the auto generated properties to your new custom class and use them there. This way models builder does not generate them as they are already present and you can use the plugins.
Regards David
This sounds doable. I'll try and come back here, thanks David
is working on a reply...