开发者

What's the best way to turn a .Net class into a SQLite table?

I have a bunch of classes in a WPF application, that read data from a REST service. I've decided to save time and traffic by saving the replies that rarely change in a SQLite database. I'm planning to use System.Data.SQLite to access the db.

开发者_如何学Go

My question is: what's the best (read: elegant, fast, nice) way to take class properties and turn it into a SQL Create statement? Yes, I can start typing and configuring, and it would take less than an hour, but Ihave a nagging feeling I am missing a trick or two here.

Any reply acceptable: Visual Studio tool, Linq, a class attribute I'm missing - I am in a learning mode/mood.

Thanks for your time and replies.

Guy


Why not use an ORM like NHibernate, and have it automatically generate your schema for you? this both handles your issue at hand, and also saves you from a bunch of left hand/right hand coding to populate your tables down the road.


You should find yourself an ORM which will do this for you.


Try Devart dotConnect for SQLite - http://www.devart.com/dotconnect/sqlite/, this product contains an enhancement of LINQ to SQL which works with SQLite databases. This solution will be very elegant and fast.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜