Bit.Api.Controllers.SitesController.Put C# (CSharp) Method

Put() private method

private Put ( string id, [ model, string expand = null ) : Task
id string
model [
expand string
return Task
        public async Task<SiteResponseModel> Put(string id, [FromBody]SiteRequestModel model, string[] expand = null)
        {
            var site = await _cipherRepository.GetByIdAsync(new Guid(id), new Guid(_userManager.GetUserId(User)));
            if(site == null || site.Type != Core.Enums.CipherType.Site)
            {
                throw new NotFoundException();
            }

            await _cipherService.SaveAsync(model.ToCipher(site));

            var response = new SiteResponseModel(site);
            await ExpandAsync(site, response, expand, null);
            return response;
        }