Click here to Skip to main content
15,889,034 members
Articles / All Topics

Ektron Content Types and AutoMapper

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
11 Aug 2011CPOL1 min read 15.4K   1
Ektron content types and Automapper

If you are working with Ektron, you are probably already aware of Ektron SmartForms and the ability to turn them into strongly typed Content Types. If you are not familiar and want to get up to speed, I recommend taking a gander at Bill Cava's webinar on the subject located here. This is a great step in making it a bit easier to do some CRUD operations on SmartForm content but depending on what your SmartForm looks like, you might get a weird looking Content Type class when just relying on the class creation from using the xsd.exe tool.

Taking the transformation a step further and turning the Content Type class into a true Domain Object can make your code a bit cleaner and further separate your business layer from your data layer which is always nice. Jimmy Bogard has a nice AutoMapper project located over at CodePlex that you can leverage to move between your domain objects and your SmartForm content types.

Automapper does a nice job of figuring out which field should be mapped to which field and it has the flexibility for you to take control of the mapping at a field or type level. If you have a Rich Text field in your SmartForm, you will probably want to do something similar to the sample code below which introduces a custom resolver that makes it easier to map from a string field on the domain object to the corresponding rich text field on the SmartForm.

Automapper

Permalink | Leave a comment  »

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead Independent Consultant
United States United States
___________________________
J A M E S C O L E M A N
Director, Technical Services
Linked-In: http://www.linkedin.com/in/jameswcoleman
Blog: ledtalks.wordpress.com

Comments and Discussions

 
QuestionMissing Image Pin
Mike Sims11-Jun-14 3:40
Mike Sims11-Jun-14 3:40 
Can you update the image please? It isn't loading.
Thanks.
Mike

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.