public async Task <ActionResult> Detail(string id) { var storage = await _storageDbCommand.FindAsync(id); if (storage == null) { return(HttpNotFound()); } if (storage.Owner != User.Identity.Name) { return(new HttpUnauthorizedResult()); } return(PartialView("_Detail", Mapper.Map <StorageIndexModel>(storage))); }
public async Task CreateCommonTest() { var storage = Storage.NewStorage("CreateCommonTest", "Owner", StorageType.Common); storage.ConnectionProperties = new ConnectionProperties(@"(localdb)\v11.0", "BloqsTest_CreateCommon", "sa", "password"); storage.IsSuspended = true; storage.ThresholdLength = 20000; await _dbCommand.CreateAsync(storage); var created = await _dbCommand.FindAsync(storage.Id); created.IsStructuralEqual(storage); }