private EnsembleResource BuildEnsembleResource(EnsembleCreate model)
        {
            var entity = new EnsembleResource();

            entity.Title          = model.Title;
            entity.Description    = model.Description;
            entity.DateCreated    = DateTimeOffset.Now;
            entity.IsDownloadable = model.IsDownloadable;
            entity.IsPublic       = model.IsPublic;
            entity.TeacherId      = model.TeacherId;
            entity.File           = _fileHelper.BuildResourceFile(model.File);
            entity.Ensemble       = model.Ensemble;
            entity.Skill          = model.Skill;
            entity.GradeLevel     = model.GradeLevel;

            return(entity);
        }
 public ActionResult CreateEnsemble(EnsembleCreate model)
 {
     if (this.ModelState.IsValid)
     {
         var service = CreateResourceService();
         if (service.CreateResource(model))
         {
             TempData["SaveResult"] = "Resource was successfully published.";
             return(RedirectToAction("Detail", "Teacher", new { id = this.User.Identity.GetUserId() }));
         }
         else
         {
             TempData["ErrorMessage"] = "Resource could not be added. Try again later.";
             return(RedirectToAction("Detail", "Teacher", new { id = this.User.Identity.GetUserId() }));
         }
     }
     else
     {
         return(View(model));
     }
 }