Is it safe to have an IDisposable model in asp.net mvc?

Is the following code normal?

public ActionResult MyController() { using(var model=new MyControllerModel()) { return View(model); } //does framework access model after this point? //If so, I need to rethink } 
+4
source share
1 answer

A structure most specifically refers to a model after it returns an ActionResult . ActionResults have their own Execute() methods called to generate content.

+4
source

Source: https://habr.com/ru/post/1299499/


All Articles