Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • nickornotto 397 posts 900 karma points
    Nov 08, 2017 @ 09:22
    nickornotto
    0

    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?

  • Alex Skrypnyk 6148 posts 24097 karma points MVP 8x admin c-trib
    Nov 08, 2017 @ 10:30
    Alex Skrypnyk
    0

    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

  • nickornotto 397 posts 900 karma points
    Nov 08, 2017 @ 10:45
    nickornotto
    0

    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.

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Nov 08, 2017 @ 11:03
    David Brendel
    0

    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

  • nickornotto 397 posts 900 karma points
    Nov 08, 2017 @ 11:18
    nickornotto
    0

    This sounds doable. I'll try and come back here, thanks David

Please Sign in or register to post replies

Write your reply to:

Draft