How GlassMapper works
Glass Mapper is an object relational mapping (ORM) tool in Sitecore. It maps Sitecore items to strongly-typed classes. This makes it simple to access Sitecore data within C# code. Without an ORM, Sitecore developers would need to write and manage a lot of mapping code.
Below are example files that you can use. You have an interface class file, a class file that implements the interface and lastly you can use this in your cshtml file.
That's it. Happy Sitecoreing!
IMySitecoreItemName class file
Use it on your .cs file
Use it on your .cshtml file
Comments
Post a Comment