English 中文(简体)
非洲开发银行在演播室视觉设计战略
原标题:DB design strategy in Visual Studio

I m目前正在调查ASP。 NET MVC 2 and LINQ tokou. 这完全是冷却。 但我有一些应用和发展生命周期问题。

Currently, I design the DB in SqlServer Management Studio. Then I update my DBML files by deleting and re-importing modified tables.

问题:

  1. I can t find how to simply update the whole DBML schema.
  2. My DBML then loses some of the changes I made such as renaming relation members or mapping of some int to an enum.
  3. If I want a SQL script to deploy my DB (or to keep the schema under source control), I need to go use the Genererate Script SSMS wizard which would be cool if a) it could remember my settings and b) it could be automated.

我是否应该以其他方式工作(从我的DBML开始,产生行文)? 我是否应该谈谈其他一些框架(NHibernate?)? 我能否使用一些Linq的弹)?

此外,我读到,LINQ2SQL已经过时,有利于Linq的实体。 这是否意味着,使我的生活更加美好的最终工具将再次使我长期失去时间?

感谢 light光。

最佳回答

作为后续行动,我要说,我最终发现并亲爱了。 Huagati DBML/EDMX Tool

为了完全诚实,我必须说,自我购买以来,价格大幅上涨。 我认为,这笔钱仍然值得。

而那些正在寻找用于MySQL(或其他)的同类工具的人,Dev是你的朋友。

问题回答

对LINQ2SQL及其是否陈旧或停职存在许多意见。 但是,它仍在。 NET框架和良好工具,如果适合你们的需要,那么你就应当加以利用。 坦率地说,《实体框架》仍然不完美,如果你不需要额外的灵活性,那就不值得痛苦。 如果我有一个小到中的项目,那么我肯定会再次使用LINQ2SQL(和超过EF)。

至于你的问题,如果你去掉并重新填写表格,你会丢失任何名字或不同的类型地图。 我知道的备选办法

  1. Only remove / re-add the table that has changed (not all tables)
  2. Try altering the DBML tables in place, rather than remove / re-add. You can add and remove columns, change column names and data types, add relationships all on the DBML.

如同JcMalta一样,我建议,在将物体输入数据库之前,将物体列为类别,但如果你发现Sum迅速开发,则可能最快地制作表格,就会将其输入你的DBML。 它对必须改变数据库中的某件事以及把改动推向你的代码,是一种触动,但代号工具非常好,并且消除了大部分的痛苦。





相关问题
Entity Framework with File-Based Database

I am in the process of developing a desktop application that needs a database. The application is currently targeted to SQL Express 2005 and works wonderfully. However, I m not crazy about having ...

Assistance with CakePHP model relationships

How would I represent the following in a CakePHP model? Product ======= product_id .... Cart ==== cart_id .... Carts_Products ============== cart_id product_id quantity

join across databases with nhibernate

I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...

How are Models (in MVC) and DAOs supposed to interact?

How are models and DAOs supposed to interact? I m in the process of putting together a simple login module and I m unsure where to put the "business logic." If I put the logic with the data in the ...

Convert date to string upon saving a doctrine record

I m trying to migrate one of my PHP projects to Doctrine. I ve never used it before so there are a few things I don t understand. In my current code, I have a class similar to this: class ...

热门标签