简体   繁体   中英

Visual Studio in which folder should I save dbml files for Linq to SQL

After googling on Internet I came to conclude that I should save the dbml files in App_Code folder. Please suggests me if its right or not.

I am using asp.net webforms

Generally I'd recommend that you put your DBML file under your Data Access Layer (DAL) , which should be a separate class library project in your VS solution. That way, it's easier to manage/maintain your DAL code in the future as it's separated from your main web interface.

With all that said, it also really depends on the size of your project. If it's an enterprise application, then definitely go for a n-tier architecture and it will benefit you in the long run. The last thing you want is having your data access/business logic code tightly embedded with the UI. Hard to debug, hard to test, hard to maintain...

On the other hand, if it's just a prototype/small project, then sure you can have everything prepared in one web app project as you want to knock out the project fast.

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