ASP.Net MVC: Best Practices for dbml files

前端 未结 3 1877
挽巷
挽巷 2021-01-01 00:42

This may just be a yes or no type of question but here goes anyway...

From all (well most) of the examples that I\'ve seen for using mvc, it appears that method for

3条回答
  •  迷失自我
    2021-01-01 01:03

    I'm not sure yet - its a problem I'm still working on but I think that the answer is that should it be desirable to have multiple dbml files - effectively views of your data - then you want to host the dbml files in their own projects so that you can have the similar things in multiple namespaces and not have them conflict.

    This being the case the next logical step is to put your dbml files/models into their own projects by default and to learn to work with them when set up that way. This will also aid reuse of a model of database where you have more than one application interacting with that database.

    There are certainly issues with separating the thing out and also with having multiple dbml files in a a single project (in terms of ensuring that extensions to the classes are implemented conistently in all instances for example) but I've got a case where its not inappropriate.

    Good question, answer probably tends towards being "just one" but not in every case...

提交回复
热议问题