Giter Site home page Giter Site logo

Comments (5)

damieng avatar damieng commented on May 24, 2024

Can you explain your folder structure a bit more along with where the output was expected? Thanks

from damiengkit.

mmu69 avatar mmu69 commented on May 24, 2024

This is how the CodeTemplates folder inside my project looks like. Lis.cs.t4 is using the MultipleOutputHelper to create an aditional file called "_IndexList.cshtml"
image

When i scaffold the list template (by adding a view in a views folder, by right clicking on the "return view" statement inside a controller or scaffolding a mvc controller including views), i expeected the _lindexList.cshtml to be in the same folder as the Index.cshtml. Like this:
image

The additional file "_IndexList.cshtml" is not in the views folder together with "Index.cshtml", but is created in the CodeTemplates folder with the t4 files
image

from damiengkit.

damieng avatar damieng commented on May 24, 2024

The helper does not know or understand anything about MVC as it is a generic helper designed for all sorts of code generation (it was actually originally written for generating multiple files for LINQ to SQL).

The default behavior is to generate the files as sub-items beneath the T4 file that generates them and to put the files in the same folder as the T4 file.

I think from your screenshots then it is behaving as designed.

For this to put files in a flexible way we'd need to add support for an extra folder name to the Process call inside List.cs.t4 I suspect, e.g.

manager.Process(true, '..\..\t406')

from damiengkit.

damieng avatar damieng commented on May 24, 2024

I looked into this a little more - the code that adds the files to the solution would also have to be changed - right now it adds them as sub-files under the generated file. If you want them somewhere else then it has no idea which files it 'owns' so can't delete old files any more...

from damiengkit.

damieng avatar damieng commented on May 24, 2024

Can't reliably build this in as per the notes above. If people need this behavior they'll have to hack the helper directly and somehow just "know" which files to delete when it recreates.

from damiengkit.

Related Issues (14)

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.