Comments (5)
If you changed it to compare to "ID" instead of "id" does it work for you? Apparently ToUpper works better for Turkey, don't know if it fails for other cultures though.
from dapper.contrib.
ToUpper can make it "İD", so it will fail again :)
I think the best way is adding culture to string.equal operation. For now, we wrote a custom convert method to change ıd to id, İD to ID etc.
from dapper.contrib.
@yusufozturk
Could you share your ext. method ? or what does it exactly do for it ?
from dapper.contrib.
Setting a culture is tricky, you would need your code and Database to share the same culture which might not always be the case.
from dapper.contrib.
We should probably address this by using whatever locale is used in the model object, by changing the hardcoded "id" to grabbing the variable name from the object itself. This would mean that if they define the model in turkish(is that the name of the language?) that should give us the correct variable to query against. (grabbed via the [Key] attribute, of course)
Edit: NVM, this is not needed. This is an internal thing. We are using the wrong method for comparing them, I think.
see reference: https://msdn.microsoft.com/en-us/library/system.stringcomparer.currentcultureignorecase(v=vs.110).aspx
from dapper.contrib.
Related Issues (20)
- Why a hard reference to the column "id" HOT 5
- IsWriteable not working on Key columns
- System.Data.SqlClient.SqlException: "Cannot insert the value NULL into colum..." (DateTime) HOT 1
- Insert<T> return non-int HOT 2
- Does not work with OleDbConnection HOT 1
- Stupid initiative on plural entity name - REMOVE! HOT 1
- GetAsync fails on SQL Server when the primary key property is a reserved SQL keyword
- InsertAsync and Insert fail if the id is not an int
- Inherited TableAttribute is ignored by CRUD operations
- Snowflake query parameters syntax is not supported HOT 1
- Dapper.Contrib.dll not signed HOT 1
- MySqlAdapter InsertAsync unexpectedly modifies entityToInsert
- Add Bookstore WebAppExample
- Internal Table Properties are Ignored
- No documentation of failure states (or it is hard to find if it exists?)
- Cannot use SqlMapperExentions.Table attribute on structs
- Pervasive/Actian Zen (PSQL)
- Is Dapper.Contrib being actively maintained? HOT 3
- [Question] WriteAtrribute to be inherited
- Usage with EF-related POCOs. Operations fail on navigation properties HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dapper.contrib.