Search code examples
c#asp.netdatabasewcfdata-access-layer

How to create Data access layer


I have two projects wcf service and a web site, both will use a common database. So I want to write a data access layer which will use in both and contains entity data model. So now my question is, how to do that, what kind of project template i use for DAL, and where to create db, right now it remains locally.


Solution

  • You're right that you want it in a different DLL which you can reference from both projects. The easiest way to do this is by creating a new project of type Class Library