src/fursvp.data/RepositoryDecorators/RepositoryWithAuthorization.cs
/// <summary>
/// Overwrites an existing document representing the entity to the repository if the user is authorized.
/// </summary>
/// <param name="updatedEntity">The entity to persist to the repository.</param>
/// <returns>An asynchronous <see cref="Task{T}"/>.</returns>
Overwrites an existing document representing the entity to the repository if the user is authorized.
Overwrites an existing document representing the entity to the repository if the user is authorized .
public async Task Update(T updatedEntity)
        {
            var oldEntity = await RepositoryRead.GetById(updatedEntity.Id).ConfigureAwait(false);
            if (oldEntity == null)
            {
                throw new ValidationException<T>("Must provide a valid id");
            }
            Authorize.WriteAuthorize(oldEntity, updatedEntity);
            await Decorated.Update(updatedEntity).ConfigureAwait(false);
        }
public async Task Update ( T updatedEntity ) { var oldEntity = await RepositoryRead . GetById ( updatedEntity . Id ) . ConfigureAwait ( false ) ; if ( oldEntity == null ) { throw new ValidationException < T > ( " " ) ; } Authorize . WriteAuthorize ( oldEntity , updatedEntity ) ; await Decorated . Update ( updatedEntity ) . ConfigureAwait ( false ) ; }
Overwrites an existing document representing the entity to the repository if the user is authorized.
Overwrites an existing document representing the entity to the repository if the user is authorized .
An asynchronous .
An asynchronous .
updatedEntity
T
The entity to persist to the repository.
The entity to persist to the repository .