Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
146 views
in Technique[技术] by (71.8m points)

subsonic3 - Use subsonic 3.0 SimpleRepository to a existing database

I want to use subsonic 3.0 SimpleRepository in my project, but there is a problem :

If my table's name like Product etc. then I can't get any data from database, because subsonic generate the sql statement like "Select * from Products ..."

PS: I don't want to change my table name.

I wrote a t4 template to solve this problem, I hope someone can take a look at my code and tell me am i do the right thing?

Code: SimpleRepositoryDemo

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It sounds like you already have a database designed in which case I would suggest you use the LinqTemplates or ActiveRecord instead. SimpleRepository seems to really be suited to a code first development process rather than a database first.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...