Last post Apr 13, 2010 07:41 PM by AceCorban
Apr 12, 2010 12:45 PM|SamahS|LINK
Is there any way or design pattern can I use to get Generic CRUD operation?
Because I’m working on n-tire application using EF in the data layer and I don’t want to use CRUD Functions in Every Entities.
Your help would be appreciated
Apr 12, 2010 02:16 PM|AceCorban|LINK
Look into MVC for ASP.NET. It has a lot of built-in features to create pages for each of the CRUD operations.
Check out this tutorial to implement a semi-complex application using MVC:
Apr 12, 2010 02:54 PM|SamahS|LINK
Thanks for your response, but I'm not using MVC I use the asp.net WebFrom.
So Is there another solution??
Apr 12, 2010 04:51 PM|amisol|LINK
Check out Linq to SQL or Entity Framework or any other ORM tool.
Apr 12, 2010 10:11 PM|SamahS|LINK
I heard about the Repository Pattern .Is that the right technical to use with EF to get the Generic operation in n-tire application?
Apr 12, 2010 10:23 PM|Das.Sandeep|LINK
I will prefer to use Entity spaces.
Apr 12, 2010 10:51 PM|SamahS|LINK
Can you give more details?
Apr 12, 2010 10:57 PM|Das.Sandeep|LINK
It is chargeable but easy for rapid development.
Apr 12, 2010 11:04 PM|SamahS|LINK
Thank you for you response
but Is there any problem in Repository Pattern or Unit Of Work Pattern ????
Apr 13, 2010 07:41 PM|AceCorban|LINK
I use repository pattern for Linq To Sql. The Nerd Dinner tutorial I listed above actually discusses how to do it. I haven't worked with the Entity Framework much, so I'm not sure how easy it is to port over, but I imagine the concepts are the same. I
like the repository pattern because you can swap out your underlying datamodel framework and the rest of your code can remain unchanged. So if your code does something like this:
UserAccount userAccount = userAccountRepository.GetUser(userId);
and you decide your datamodel has to change significantly for whatever reason, all your business logic can stay the same if you just modify the "GetUser" function.