Created
September 16, 2015 15:49
-
-
Save cardinal252/d485fd9fb69585dc5525 to your computer and use it in GitHub Desktop.
Using Typed GlassControllers to provide DataSource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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