private async Task UpdateFields(IDbConnection connection, TModel model, List <PropertyInfo> propertiesToUpdate)
        {
            var sql = propertiesToUpdate == _properties ? _updateSql : GetUpdateSql(propertiesToUpdate);

            SqlBuilderExtensions.LogQuery(sql, model);

            await connection.ExecuteAsync(sql, model);
        }
        private async Task <TModel> Insert(IDbConnection connection, TModel model)
        {
            SqlBuilderExtensions.LogQuery(_insertSql, model);
            var id = await connection.ExecuteScalarAsync <int>(_insertSql, model);

            _keyProperty.SetValue(model, id);

            return(model);
        }
        private async Task UpdateFields(IDbConnection connection, IList <TModel> models, List <PropertyInfo> propertiesToUpdate)
        {
            var sql = propertiesToUpdate == _properties ? _updateSql : GetUpdateSql(propertiesToUpdate);

            foreach (var model in models)
            {
                SqlBuilderExtensions.LogQuery(sql, model);
            }

            await connection.ExecuteAsync(sql, models);
        }