Git Product home page Git Product logo

dapper.extensions's People

Contributors

ebrahimkhodadadi avatar zeelyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dapper.extensions's Issues

Cache invalidation

Hi, are there any plans to add an invalidate function to remove a cache entry by key?

Use MySqlConnector for async I/O

The MySqlDapper code uses Dapper's QueryMultipleAsync, which will call DbConnection.ExecuteReaderAsync. It's a long-standing bug in MySql.Data (bug 70111) that async I/O is not implemented correctly; thus all these methods will actually run synchronously. (See also here and here on Stack Overflow.)

To fix this, you could switch to https://github.com/mysql-net/MySqlConnector, an OSS replacement for MySql.Data that supports true asynchronous I/O; it also has full .NET Standard/.NET Core support.

If you're interested in this, I'd be happy to open a PR.

SemaphoreFullException

after executing this code sometimes the error thrown

await _connection.QueryAsync<GroupQuery>(sql: query, param: parameters, cacheKey: cacheKey.ToString());

System.Threading.SemaphoreFullException
Adding the specified count to the semaphore would cause it to exceed its maximum count.

only cache simple sample

Dapper.Extensions have many functions
but, i want use simple dapper and cache like

                using (var conn = GetDBCnn(connectionDbType, connectionString))
                {
                    var resultAsync = await conn.QueryAsync<T>(
                           sql, 
                           param: parameters, 
                           enableCache: true,
                           cacheExpire: TimeSpan.Parse(this.Configuration.GetValue<string>("DapperCachingDuration"))
                    );
                }

please how can i use?

Default cache key generation doesn't seem to work with DynamicParameters

Using Dapper Caching for Redis but probably the same for others.

Seemed like it was ignoring the parameters if using DynamicParameters. Returned the same value from cache even though parameters were different.

Looked at source and came up with this c# test.
var sql="some sql;
var p1 = new DynamicParameters();
var p2 = new DynamicParameters();

    p1.Add("Test1","test1");
    p2.Add("Test1","test2");
    
    var cb = new DefaultCacheKeyBuilder(new CacheConfiguration());
    var a = cb.Generate(sql, p1,"");
    var b = cb.Generate(sql, p2,"");

Generates the same cache key. Doesn't append the values of the actual parameters. I get this as the string:

RemoveUnused=True&ParameterNames=System.Linq.Enumerable+SelectEnumerableIterator2[System.Collections.Generic.KeyValuePair2[System.String,Dapper.DynamicParameters+ParamInfo],System.String]&

I uploaded a screen cap from Jetbrains Rider.

I rolled my own that iterates the values of the dynamic parameters to get the actual values.

2023-12-15_16-21-41

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.