title: How do I specify different Layouts in the ASP.NET Core MVC
body: <p>I would like to have 2 separate Layouts in my application. Let say one is for the Public section of the website and the other is empty for some reasons we need.</p>
  
  <p>Before Core I could do this to define a filter:</p>
  
  <pre><code>public class LayoutInjecterAttribute : ActionFilterAttribute
  {
      private readonly string _masterName;
      public LayoutInjecterAttribute(string masterName)
      {
          _masterName = masterName;
      }
  
      public override void OnActionExecuted(ActionExecutedContext filterContext)
      {
          base.OnActionExecuted(filterContext);
          var result = filterContext.Result as ViewResult;
          if (result != null)
          {
              result.MasterName = _masterName;
          }
      }
  </code></pre>
  
  <p>}</p>
  
  <p>Now the ViewResult do not have the MasterName property. Is it possible to do now, and not to use in the View the layout definition.</p>