/// <summary>
        /// construct new project out of form data
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        public Project ConstructProject(ProjectForm form)
        {
            var p = new Project
            {
                ProjectId = form.ProjectId,
                ProjectName = form.ProjectName
            };

            return p;
        }
        public ActionResult Create(ProjectForm projectForm)
        {
            var vm= new ProjectViewModel(projectForm);

            if (!ModelState.IsValid)
            {
                return View(vm);
            }

            var cmdResult = ExecuteCommand(new CreateProjectCommand(projectForm));

            if(cmdResult.Success) return RedirectToAction("Edit","Project", new {projectId=cmdResult.Result});
            return View(vm);
        }
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="projectForm"></param>
 public ProjectViewModel(ProjectForm projectForm)
 {
     ProjectForm = new ProjectForm(projectForm);
 }
 /// <summary>
 /// constructor 
 /// </summary>
 public ProjectViewModel()
 {
     ProjectForm = new ProjectForm();
 }
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="projectForm"></param>
 public ProjectForm(ProjectForm projectForm)
 {
     ProjectId = projectForm.ProjectId;
     ProjectName = projectForm.ProjectName;
 }
 /// <summary>
 /// Updates roject with data from the web form 
 /// </summary>
 /// <param name="projectToUpdate">project entity from database</param>
 /// <param name="projectForm">data entered on web form</param>
 public void UpdateProject(Project projectToUpdate, ProjectForm projectForm)
 {
     projectToUpdate.ProjectName = projectForm.ProjectName;
 }