开发者

ORM, C# and MySQL - Take2

This questions actually refers to another one already asked, now I want to reformulate it :)

开发者_StackOverflow

My issue is: There is an online shop running on MySQL database, hosted somewehre on the internet. Now I'd like to do some administration stuff from my C# application.

What I want to do: All I want is to run SQL-queries on that database and get the results as entities in my application so I can browse through them like through normal Lists/Classes and then post back the changes to the database. The problem is not the connection to the database - it works fine (using SSH and Connector/NET driver) - but the question, how to turn the SQL-results into C# classes.

I had a closer look at Fluent NHibernate and SubSonic, but I still can't figure out which one suits best or - even worse - if these are really the right approaches to my problem.

So I don't want to build an application which stores its own data in a database but gets the data it needs from a public database.

I hope I could make myself more clear this time :)

Thanks in advance!


ORM is definitely the way to, because it allows you to abstract your data access.

You may find a code generator helpful (to avoid the repetitive task of writing the classes and all their properties): NHibernate Code Generation.

This way you can still use classic NHibernae instead of Fluent Hibernate, which by the way looks pretty useful.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜