Coder Social home page Coder Social logo

Comments (14)

zpqrtbnk avatar zpqrtbnk commented on August 17, 2024

So both TextPage and Pages are content types, and Pages is added to TextPage, right? Then, TextPage should implement an IPages interface (compositions are implemented as interfaces) and that interface should be generated. Let me test...

from modelsbuilder.original.

zpqrtbnk avatar zpqrtbnk commented on August 17, 2024

Just created content types Test1 and Test2, both at root and without properties. Added Test1 to Test2. Here's what I have in test1.generated.cs:

    // Mixin content Type 3084 with alias "Test1"
    /// <summary>test1</summary>
    public partial interface ITest1 : IPublishedContent
    {
    }

    /// <summary>test1</summary>
    [PublishedContentModel("Test1")]
    public partial class Test1 : PublishedContentModel, ITest1
    {

And in test2.generated.cs:

    /// <summary>test2</summary>
    [PublishedContentModel("Test2")]
    public partial class Test2 : PublishedContentModel, ITest1
    {

And the solution builds. That's using the VS extension but it should not make a diff. Can you show me how you pages & textpage generated files look like?

from modelsbuilder.original.

jesperordrup avatar jesperordrup commented on August 17, 2024

Mine look somewhat the same:

https://dl.dropboxusercontent.com/u/572995/zbu.archive.zip

from modelsbuilder.original.

zpqrtbnk avatar zpqrtbnk commented on August 17, 2024

If you have

    /// <summary>Textpage</summary>
    [PublishedContentModel("Textpage")]
    public partial class Textpage : PublishedContentModel, IPages
    {

and

    // Mixin content Type 1047 with alias "Pages"
    /// <summary>Pages</summary>
    public partial interface IPages : IPublishedContent
    {

How would that break? What error are you seeing?

from modelsbuilder.original.

jesperordrup avatar jesperordrup commented on August 17, 2024

zbu in visual

heres a VS screenshot

from modelsbuilder.original.

zpqrtbnk avatar zpqrtbnk commented on August 17, 2024

Have you added the Pages.generated.cs file to the solution? This is strange.

from modelsbuilder.original.

jesperordrup avatar jesperordrup commented on August 17, 2024

Its auto added as its a "Website" (File, open Web Site ...) not a Web Application Project.

I could suspect it to be the reason but then it wouldnt work if generated on my hosting?

from modelsbuilder.original.

zpqrtbnk avatar zpqrtbnk commented on August 17, 2024

Weird. What happens when you open the file in VS?

from modelsbuilder.original.

jesperordrup avatar jesperordrup commented on August 17, 2024

Im not sure what you mean. I can open all the generated files.

The TextPage file makes the above error.
The Pages file makes no error.

But none of them works.

New finding: copying all generated files to App_Code makes everything work

from modelsbuilder.original.

jesperordrup avatar jesperordrup commented on August 17, 2024

Btw. is it possible to configure this to copy all generated files to App_Code?

from modelsbuilder.original.

zpqrtbnk avatar zpqrtbnk commented on August 17, 2024

Ahhhhh of course, the files are generated in App_Data, right? So you have EnableAppCodeModels set to true in the config, right? Then there should be a something.models file in App_Code and that file should be touched when you generate the models. I think I understand the confusion here:

EnableAppCodeModels generates models in App_Data and then creates a single something.models in App_Code so that the build manager loads all the models file at once. But that's for the ASP.NET build manager and VS will not see the files. Hence the confusion.

If you want them in VS then you'll have to use EnableAppDataModels (they won't be loaded by the build manager as we won't generate the something.models file) and then manually include the files in the VS solution.

Looks like what you want is "plain App_Code files" ie that the files are generated straight into App_Code - this is something I haven't enabled at the moment, because writing files to App_Code restarts the app... while you are writing. So we need to figure out how to delay that restart (that's possible I think) while we write all the files.

Making more sense?

from modelsbuilder.original.

jesperordrup avatar jesperordrup commented on August 17, 2024

App_data, right!
EnableAppCodeModels = true, right!

I'll try EnableAppDataModels (and disable EnableAppCodeModels i guess). I guess I then have to copy them manually to the App_Code folder.

yes - direct app_code will work everywhere.

from modelsbuilder.original.

zpqrtbnk avatar zpqrtbnk commented on August 17, 2024

Direct app_code would be nice provided that I find a way to suspend app restart while I write the files... OK, closing the question!

from modelsbuilder.original.

jesperordrup avatar jesperordrup commented on August 17, 2024

Sound great. Yes the EnableDirectAppCodeModels mode is missing 🎯
And thanks for the help!

from modelsbuilder.original.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.