Bugs in T4 template

Hi
I find some bugs in T4 template:

  1. Can not generate Views in sqlserver. a big problem.
  2. To get OrmLite.Poco.tt working, must remove the blank lines at the end of OrmLite.Poco.tt and OrmLite.Core.ttinclude(get build errors if do not do this). After generating, I find 21 blank lines on the top in the generation class.
  3. when create solution in Mac by Xamarin Studio, can not generate file automatic, but in windows it’s ok.

I will test the generator file later.

Thank you
Yin

OrmLite is predominantly a code-first ORM where you maintain the POCO models, the T4 templates is just a tool to help create the initial Table POCO’s which you’d later maintain after they’ve been generated.

T4 Templates only works reliably on Windows. Since it’s only meant to be run once, run the OrmLite T4 templates on Windows and use the outputs.

Please check the template, I find a lot of guys ask similar questions in the stack overflow, I do not think most developers use code-first method. Database is always the core in the architecture.

This bug is very serious for the guys using Ormlite at first time:
To get OrmLite.Poco.tt working, must remove the blank lines at the end of OrmLite.Poco.tt and OrmLite.Core.ttinclude(get build errors if do not do this).

And I think generate views is very important to keep code clean(i do not want to join tables by code).

Thank you
Yin

OrmLite T4 templates doesn’t generate Views, you can add this as a Feature Request.

I have done that.

Thank you.

I find you write this post https://groups.google.com/forum/#!topic/servicestack/Kf3-oVUEO6A

I think generate view is not so important that i can mix some POCOs into a new POCO to represent View. After that i can use this new POCO like others.

Am i right?

Thank you.

Yeah OrmLite doesn’t care if the POCO maps to a Table or a View, i.e. you can query Views as you would tables.

I find a flag in the ttinclude file.

If set IncludeViews = true; View will generate. :smile:

Cool :slight_smile: There’s also a IncludeFunctions=true option for generating Table Valued Functions that was contributed in the last v4.0.42 release.

@mythz is doing a fantastic job with ServiceStack, and I appreciate the code-first approach.

if you are building apps and wrappers for legacy or pre-existing well-entrenched relational models, then SS is perhaps not the best suited framework.

@sirthomas SS also support database first. i think generate POCO of database is good enough. I hope one day SS as famous as Rails or Django. If SS support more code style or platform, i will get more happiness.