Prismic Mapping Helpers
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Prismic Mapping Helpers

An attribute based mapping helper to populate objects from Prismic Documents


Available on nuget:

Install-Package benembery.PrismicMapping.Core


Add attributes to your DTO, you can name the field you want to map in the atrribute [PrismicTextField("text_named")] or leave it blank and the mapper will lower case the property name and look for that field name in the prismic document instead.

private class ExampleMappingClass
    public string Id { get; set; }

    public string Text { get; set; }

    public string NamedText { get; set; }

    public StructuredText StructuredText { get; set; }

    public StructuredText NamedStructuredText { get; set; }

    public DateTime DateTime { get; set; }

    public DateTime? DateTimeNullable { get; set; }

    public TestMappingClass()
        Child = new TestChildPropertyMappingClass();

When you need to map the document, call the mapper as follows.

var result = PrismicMapper.Map<ExampleMappingClass>(document);


  • Add Method CreateMap to pre-cache the mapping plans and which will improve first map performance.
  • Got a suggestion get in touch on twitter @benembery