public bool Validate(AdventureTypeTemplate item, IList<ValidationResult> validationErrorResults)
        {
            if (null == validationErrorResults)
                validationErrorResults = new List<ValidationResult>();

            return validationErrorResults.Count == 0;
        }
 //
 // GET: /AdventureTypeTemplate/Create
 public ActionResult Create()
 {
     var adventureTypeTemplate = new AdventureTypeTemplate();
     for (int i = 0; i < 5; i++)
     {
         adventureTypeTemplate.DataCards.Add(new AdventureDataCard());
     }
     return View(adventureTypeTemplate);
 }
        public ActionResult Create(AdventureTypeTemplate adventureTypeTemplate)
        {
            adventureTypeTemplate.DataCards.RemoveAll(
                                                            d => string.IsNullOrEmpty(d.Title) &&
                                                                string.IsNullOrEmpty(d.Body));

            if (ModelState.IsValid)
            {
                AdventureTypeTemplate template = TypeTemplateRepository.SaveTypeTemplate(adventureTypeTemplate);
                //return View("Details", new { te});
            }

            return View("Index");
        }
 public AdventureTypeTemplate SaveTypeTemplate(AdventureTypeTemplate template)
 {
     template = Client.Post<AdventureTypeTemplate>("/Adventure/TypeTemplates/", template);
     return template;
 }
 public AdventureTypeTemplate SaveTypeTemplate(AdventureTypeTemplate template)
 {
     return string.IsNullOrEmpty(template.Id) ?
        AdventureTypeTemplateRepository.Add(template) :  // Add new one  &
        AdventureTypeTemplateRepository.Update(template); // update existing one
 }