Skip to content

Instantly share code, notes, and snippets.

@cardinal252
Created September 16, 2015 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cardinal252/d485fd9fb69585dc5525 to your computer and use it in GitHub Desktop.
Save cardinal252/d485fd9fb69585dc5525 to your computer and use it in GitHub Desktop.
Using Typed GlassControllers to provide DataSource
public class MyTypedController : GlassController<IContentItem>
{
public ActionResult DisplayControl()
{
return View(DataSource); // returns the view using the DataSource as the model of type IContentItem
}
}
public interface IContentItem
{
Guid Id { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment