0

There is of course no such option as using customizable scaffolding from EF6 model to views/controller in DNX project's in newest MVC 6. But I've tried to use the PM console command Scaffold (aka Invoke-Scaffolder, from T4Scaffolding.Core.1.0.0\tools\T4Scaffolding.dll ) to investigate what custom codegeneration could migrate and what could not.

Scaffold -Scaffolder Controller -Project DemoDnxMvcApp -OverrideTemplateFolders "D:\cot\klik\kk\vse\V1.DnxMvcApp\" -Force Templates

and get an error 'project DemoDnxMvcApp not found'. It seems t4 scaffolder doesn't understand xproj projects, can't process them.

But also I've noticed there is now possibility to create and execute t4 template inside a such project (e.g that could generate TypeScript from EF6 model).

  • How I could make T4 EF6 scaffolding working with xproj projects?
  • How I could make even simple T4 template working in DNX project ?
  • What tool could replace it in DNX projects if T4 is not supported any more (not enough 'crossplatform')?

P.S. (beta5 DNX used)

Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142

2 Answers2

1

So T4 support in the latest .net is going to be there according to this git hub issue but I don't think it is high on the priority list. I am guessing that they will be pushing yeoman templates since everything else they are doing in DNX now is looking more and more like node.

Frank
  • 2,178
  • 2
  • 17
  • 24
  • did a little more digging and found this [npm package](https://www.npmjs.com/package/generator-aspnet) that might be what you are looking for, and it appears to be pretty up to date as of 11/2015 – Frank Nov 10 '15 at 21:20
  • There should be a lot of code wroted till yeoman would be able to generate something from EF6 model. Thank you very much for pointing me this git hub issue. – Roman Pokrovskij Nov 10 '15 at 22:44
  • So an alternative might be to have just a class library which can work with T4, use this class library to hold your templates and generate your outputs, then copy the results to the xproj, you can even use grunt to make the copy tasks easy or automatic, this would let you keep working and then once xproj supports T4, just move your templates there – Frank Nov 11 '15 at 14:41
  • Preaching to the choir, I would love to see them better support T4 in the future but I don't get that they have a strong commitment to code generation, as the T4 project was an offshoot inside MS to start with and in the last release (VS2015) it didn't get much love at all, I don't think they added one new feature. Hopefully they will come out and either fully support T4 or release something better to replace it, which should not be razor, since it can't generate any type of text file like T4. – Frank Nov 11 '15 at 15:14
0

Now I can answer at least on third part of the question:

It should be possible to generate Web Api from EF6 model using Rolsyn, and then generate client side from web api using tools like yeoman.

Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142