コード例 #1
0
 public ActionResult Detail(string id) {
     var user = this.CurrentSecurityUser;
     if (user != null) {
         var account = user.CloudStorageAccounts.SingleOrDefault(a => a.PublicKey == Guid.Parse(id));
         var model = new CloudStorageAccountDetailViewModel {
             CloudStorageAccount = account
         };
         return View(model);
     }
     return View();
 }
コード例 #2
0
        public ActionResult Detail(string id) {
            var user = this.CurrentSecurityUser;
            Guid publicKey = Guid.Parse(id);
            if (user != null) {
                var account = user.CloudStorageAccounts.SingleOrDefault(a => a.PublicKey == publicKey);

                if (account == null) {
                    if (this.User.IsInRole("Developer")) {
                        account = DBContext.CloudStorageAccounts.SingleOrDefault(a => a.PublicKey == publicKey);
                    }
                }

                var model = new CloudStorageAccountDetailViewModel {
                    CloudStorageAccount = account
                };
                return View(model);
            }
            return View();
        }