tags:

views:

292

answers:

1

To update an Entity of database (table) we directly inherit Model Entity to view page like

<%@ Page Title="Edit" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MVCProject.Models.Preson>" %>

And Then Post method of Edit is called from controller, and at last, Entity updates By savechanges method of LINQ class or EF.

But user should allowed to update "Preson" Entity only for selected fields, rest of the fields should set automatically.

User should have only selected values, to be editable in his view. And the Entity should be inherited from our service layer e.g. <MVCProject.ServiceLayer.Preson>.

This would be the best way to split application into tires.

Now, Anybody knows, How to create classes in service layer, and map them to databasecontext (in case of LINQ class)?

A: 

Examine this tutorial, it has heaps of info about abstracting away a Service layer for an MVC application.

cottsak