コード例 #1
0
        public HttpResponse Create(string id)
        {
            if (!this.IsUserSignedIn())
            {
                return(this.Redirect("/Users/Login"));
            }

            SingleRepoViewModel repository = this.repositoryService.GetRepoById(id);

            return(this.View(repository));
        }
コード例 #2
0
        public SingleRepoViewModel GetRepoById(string id)
        {
            Repository repository = this.db.Repositories.FirstOrDefault(r => r.Id == id);

            SingleRepoViewModel allReposViewModel = new SingleRepoViewModel()
            {
                Id = repository.Id,
                Name = repository.Name
            };

            return allReposViewModel;
        }