public ActionResult Create(Title title)
{
var titleToCreate = new Title();
TransferValues(title, titleToCreate);
if (ModelState.IsValid)
{
RepositoryFactory.TitleRepository.EnsurePersistent(titleToCreate);
Message = "Title Created Successfully";
return(RedirectToAction("Index"));
}
else
{
var viewModel = TitleViewModel.Create(Repository);
viewModel.Title = title;
return(View(viewModel));
}
}