Exemplo n.º 1
0
        /// <summary>
        /// Attempts to get a storage site from the underlying repository and throws a <see cref="StorageSiteNotFoundException"/> if no matching site could be found.
        /// </summary>
        /// <param name="id">ID of the storage site to get.</param>
        /// <exception cref="StorageSiteNotFoundException">Thrown if no matching site could be found.</exception>
        /// <returns>Returns the storage site, if found.</returns>
        private StorageSite GetStorageSiteOrThrowNotFoundException(Guid id)
        {
            StorageSite site = LocationsRepository.GetStorageSite(id);

            // Check for site existence
            if (site == null)
            {
                throw new StorageSiteNotFoundException(id);
            }

            return(site);
        }