Header

Saturday, September 3, 2011

Entity Framework Tidbit 1

I'm not going to discuss on how to use the entity framework since there are a number of tutorials available in the web. I'll just share a realization I had while trying to do a sample application using the entity framework. In most examples I've read, I noticed that the entity objects are exposed in all projects where they are used in the solution. For simple applications, this kind of implementation is somehow acceptable. However, in enterprise-level applications, this won't do since there are a lot of issues that come into play such as security, performance and etc. Since my current is somehow an enterprise application, I was instructed to find a workaround so that I won't be exposing the entity objects to the web service projects. I read a number of articles before I came across the solution for this problem. I found out that referencing the auto-generated entity object classes in another project and adding a reference to it in the web service project is the solution for the issue. With this, you won't have to reference the entity model project in the web service project but you are still able to use the data from the entity object which were persisted to the entity classes. I'll be starting to apply the entity framework to the actual application I'm working on next week. Hopefully, everything will go smoothly and I'll find something interesting to share which would help those who are new in using the entity framework.