Пример #1
0
        public async Task <IActionResult> AddAssetToSpace(string assetId, string spaceId)
        {
            Space space;

            try
            {
                space = await _spaceService.AddAssetToSpace(assetId, spaceId);

                if (space == null)
                {
                    return(StatusCode(500, "Internal server error"));
                }
            }
            catch (SpaceRepositoryException ex)
            {
                return(StatusCode(500, ex.Message));
            }
            catch (AssetRepositoryException ex)
            {
                return(StatusCode(500, ex.Message));
            }
            return(Ok(space));
        }