예제 #1
0
        /// <summary>
        /// This action creates a view model with a collection of projects and references
        /// It is the main page of the app
        /// </summary>
        /// <param name="projectName"></param>
        /// <returns>ActionResult(ViewModel)</returns>
        /// [HttpGet]
        public async Task <ActionResult> App(string projectName)
        {
            ViewModel viewModel = new ViewModel {
                SelectedProject = projectName ?? "Select...",
                Projects        = await _repository.GetProjects()
            };

            viewModel.Projects.Insert(0, new Project {
                Title = "Select...", Id = -1, eTag = string.Empty, Type = string.Empty
            });
            viewModel.ReferenceEntityType = await _repository.GetReferenceEntityType();

            return(View(viewModel));
        }