Ejemplo n.º 1
0
        public async Task <TDataEntity> Update(TDataEntity dataEntity)
        {
            if (dataEntity is null)
            {
                throw new ArgumentNullException(nameof(dataEntity));
            }

            var command = BuildUpdateCommand(dataEntity);

            using (var connection = new SqlConnection(_databaseConfiguration.ConnectionString))
            {
                var updatedDataEntity = await connection.QuerySingleAsync <TDataEntity>(command, dataEntity);

                _cacheHandler.UpdateExisting(updatedDataEntity);

                return(updatedDataEntity);
            }
        }