Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to dispose objects correctly (ASP.NET MVC Entity Framework)
- public ActionResult Detail(Guid id)
- {
- Attachment attachment = null;
- using (var attachmentRepository = IoC.Resolve<AttachmentRepository>())
- {
- attachment = attachmentRepository.SelectByKey(id);
- return View("Detail", attachment);
- }
- }
- public ActionResult Detail(Guid id)
- {
- Attachment attachment = null;
- var attachmentRepository = IoC.Resolve<AttachmentRepository>();
- attachment = attachmentRepository.SelectByKey(id);
- return View("Detail", attachment);
- }
Advertisement
Add Comment
Please, Sign In to add comment