コード例 #1
0
        public Vault Get(int id)
        {
            Vault exists = _vr.Get(id);

            if (exists == null)
            {
                throw new Exception("Invalid Id");
            }
            return(exists);
        }
コード例 #2
0
ファイル: VaultsService.cs プロジェクト: GreavesJim/keepr
        internal IEnumerable <Vault> Get(string userId)
        {
            var found = _repo.Get(userId);

            if (found == null)
            {
                throw new Exception("Invalid id");
            }
            return(found);
        }
コード例 #3
0
ファイル: VaultsService.cs プロジェクト: Levi-Bruner/Keepr
        internal Vault Get(int id)
        {
            Vault found = _repo.Get(id);

            if (found == null)
            {
                throw new Exception("Invalid Id");
            }
            return(found);
        }
コード例 #4
0
        internal Vault Get(int id, string userId)
        {
            Vault found = _repo.Get(id);

            if (found == null)
            {
                throw new Exception("Invalid Id");
            }
            if (found.UserId != userId)
            {
                throw new Exception("You are not the owner");
            }
            return(found);
        }
コード例 #5
0
        /// <summary>
        /// creates a new relation. checks for private / public
        /// </summary>
        /// <param name="newRelation">a vaultKeep object representign the new assiciation</param>
        /// <param name="userId">the user trying to create the association</param>
        internal VaultKeep Create(VaultKeep newRelation, string userId)
        {
            Keep foundKeep = _krepo.Get(newRelation.KeepId, false);

            // two states:
            // found, is private, not created by person makign the request
            // found, not private

            if (foundKeep.IsPrivate && foundKeep.UserId != userId)
            {
                throw new ArgumentNullException(nameof(newRelation.KeepId), "That Keep does not exist");
            }
            // found is public or we made it and it is private

            // _vrepo.Get does userId checking internally
            Vault foundVault = _vrepo.Get(newRelation.VaultId, userId);


            newRelation.UserId = userId;
            return(_repo.Create(newRelation));
        }
コード例 #6
0
 public IEnumerable <Vault> Get(string userId)
 {
     return(_repo.Get(userId));
 }
コード例 #7
0
ファイル: VaultsService.cs プロジェクト: JD-Fuller/keepr
 internal IEnumerable <Vault> Get(string userId)
 {
     // return _repo.Get();
     return(_repo.Get(userId));
 }
コード例 #8
0
 internal IEnumerable <Vault> Get(string currentUser)
 {
     return(_repo.Get(currentUser));
 }
コード例 #9
0
 public Vault Get(int id)
 {
     return(_repo.Get(id));
 }
コード例 #10
0
 internal object Get()
 {
     return(_repo.Get());
 }
コード例 #11
0
ファイル: VaultsService.cs プロジェクト: Inlic/keepr
 public List <Vault> Get()
 {
     return(_vrepo.Get());
 }
コード例 #12
0
        public IEnumerable <Vault> Get(string userId)
        {
            IEnumerable <Vault> vault = _repo.Get(userId);

            return(vault);
        }
コード例 #13
0
 internal object Get(string userId)
 {
     return(_repo.Get(userId));
 }
コード例 #14
0
ファイル: VaultsService.cs プロジェクト: RileyTudbury/Keepr
 internal IEnumerable <Vault> Get()
 {
     return(_repo.Get());
 }
コード例 #15
0
ファイル: VaultsService.cs プロジェクト: GabeMcClaran/Pinster
 public IEnumerable <Vault> Get()
 {
     return(_repo.Get());
 }
コード例 #16
0
 public IEnumerable <Vault> GetMyVaults(string id)
 {
     return(_repo.Get(id));
 }