Glass Mapper

Other topics

Remarks:

Visit this url for tutorials http://glass.lu/Mapper/Sc/Tutorials

The easiest way to map Sitecore data to code.

Glass.Mapper.Sc allows you to move your data from Sitecore and into your code seamlessly using strongly typed objects.

The framework allows you to map data on to c# classes and interfaces without any additional mark-up. As the data is mapped to your target objects it is converted to the target type. Take a look at this simple example:

public class Demo
    {
        public virtual Guid Id { get; set; }

        public virtual string Title { get; set; }

        public virtual DateTime Date { get; set; }

        public virtual string Url { get; set; }
    }


    public void DoWork(
            ISitecoreContext sitecoreContext)
    {
        var model = 
            sitecoreContext.GetCurrentItem<Demo>();

        var url = model.Url;
    }

Contributors

Topic Id: 8845

Example Ids: 27554

This site is not affiliated with any of the contributors.