Click here to Skip to main content
Licence CPOL
First Posted 11 Aug 2011
Views 7,830
Bookmarked 0 times

Ektron Content Types and AutoMapper

By | 11 Aug 2011 | Technical Blog
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
A Technical Blog article. View original blog here.[^]

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 farther 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)

About the Author

James Coleman

Technical Lead
ICrossing
United States United States

Member

Follow on Twitter Follow on Twitter
___________________________
J A M E S C O L E M A N
Director, Technical Services
Company: www.iCrossing.com
Blog: ledtalks.posterous.com

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 11 Aug 2011
Article Copyright 2011 by James Coleman
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid