简体   繁体   中英

Designing a data model in VS2010 and generating ORM code, application

Simply put: I have a database design in my head and I now want to use Visual Studio 2010 to create a WPF application. Key is to use the VS2010 tools to take much as possible manual work out of my hands.

  • The database engine is SQLite
  • ORM probably through DBLINQ
  • Use of LINQ
  • The application can create new, empty database instances
  • Easily maintainable (changes in data model possible)

Questions

  • How do I start designing the database model (visually) in Visual Studio 2010? Should this be an xsd? Do I do this in a separate project?
  • Next, how can I make the most use of VS2010 code generation tools to generate a Data Access Layer?
  • I suppose the Data Access Layer will be added as a Data Source (in another project?) and from there it's a rather generic data binding solution?

I tried finding clear examples of this but it's a jungle out there, the hunt for a solution is NOT converging to one clear method.

Update

So I decided to use ADO.NET entity framework, DBLINQ is out of the picture. I downloaded and installed the System.Data.SQLite ADO.NET provider which integrates with VS2010. From the VS2010 Server Explorer one can create and design a new database but it could be done with a standalone tool for SQLite as well. I then created a new WPF application project, and in the solution explorer added an ADO.NET Entity Data Model, which automatically generates an edmx with C# code (which is the Data Access Layer) from the already created database file. WAF (waf.codeplex.com) seems like a good idea to implement the rest but plain LINQ to SQL will do. This (click here) is also a very helpful question on stackoverflow.

Kay,

Please consider using ADO .NET Framework. It's supported by VS 2010 and LINQ ( quick article ).

There is one thing you must know before designing your architecture. BLL (Business Logic Layer) is a layer of logic specific for a particular data usage, hence cannot be generated automatically by (whatever you will use) framework. I guess you had Data Access Layer in mind - don't worry about that - if you're going to use ADO .NET and LINQ to Entities, DAL will be generated for you automatically. LINQ to Entities together with ADO .NET Framework are powerful set of tools which should 100% cover your needs. Additional info about LINQ to Entities .

Please feel free to ask if you have any questions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM