Implementation of CRUD. I've solutions which read from database, I want to read using the data access layer -
// post: addresstypes/edit/5 [httppost] public actionresult edit(edit edit) { if (!modelstate.isvalid) { return view(edit); } try { using (var context = new cascadecontext()) { var addresstypes = context.addresstypes.firstordefault(x => x.id == edit.id); if (addresstypes == null) { return httpnotfound(); } context.savechanges(); return redirecttoaction("index"); } } catch { return view(); } }
Comments
Post a Comment