コード例 #1
0
        /// <summary>
        /// Updates a given area of a given storage site.
        /// </summary>
        /// <param name="siteId">ID of the site for which to update an area.</param>
        /// <param name="areaId">ID of the area to update.</param>
        /// <param name="areaName">Area name to update.</param>
        /// <returns>Returns the updated area.</returns>
        public StorageArea UpdateStorageArea(Guid siteId, Guid areaId, string areaName)
        {
            StorageSite site = GetStorageSiteOrThrowNotFoundException(siteId);
            StorageArea area = site.Areas.Where(a => a.Id == areaId).FirstOrDefault();

            if (area == null)
            {
                throw new StorageAreaNotFoundException(siteId, areaId);
            }
            area.Name = areaName;
            area      = LocationsRepository.UpdateStorageArea(area);
            return(area);
        }