views:

16

answers:

0

How do I iterate through all data and copy it to my item?

public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) {
    try {
        IRepository<ContentItem> repository = ObjectFactory.GetInstance<Repository<ContentItem>>();
        var itemId = bindingContext.ValueProvider.GetValue("CurrentItem.Id").AttemptedValue;
        // Copy all data to my item
    } catch (Exception ex) {
        // handle exception
    }            
}