Comments (5)
I didn't make any handler for this. Have to check how it's done in MySQL implementations.
Do you have any suggestion?
from identity.dapper.
Something like that
public class DapperMySqlDateTimeOffsetHandler : SqlMapper.TypeHandler<DateTimeOffset?>
{
// assume UTC in and out
public override DateTimeOffset? Parse(object value)
{
if (value == null || value == DBNull.Value) return null;
var result = DateTime.SpecifyKind((DateTime)value, DateTimeKind.Utc);
return new DateTimeOffset(result);
}
public override void SetValue(IDbDataParameter parameter, DateTimeOffset? value)
{
parameter.DbType = DbType.DateTime;
parameter.Value = !value.HasValue ? DBNull.Value : parameter.Value = value.Value.UtcDateTime;
}
}
...and then somewhere as part of a global initialization...
SqlMapper.AddTypeHandler(new YourNamespaceHere.DapperMySqlDateTimeOffsetHandler());
from identity.dapper.
Sounds good.
Do you wanna try to make a PR for this?
from identity.dapper.
@grandchamp
done
from identity.dapper.
from identity.dapper.
Related Issues (20)
- email stored in uppercase at the mysql database HOT 2
- NotSupportedException: Store does not implement IRoleClaimStore<TRole> HOT 12
- Decryption exception HOT 1
- Logo for package HOT 2
- PasswordSignInAsync throws exception HOT 4
- Assign Claims HOT 19
- User Information not updated on FindByLoginAsync HOT 2
- Environment.OSVersion HOT 5
- Claim definition
- How to use string Id for dapper identity user? HOT 2
- using guid response a cast error HOT 3
- Does not connect to the database when I use a remote database (SQL Server) HOT 6
- Dependency injection not working for SqlServerConnectionProvider HOT 4
- Connection Leaks HOT 2
- DapperUserStore is never getting disposed
- NullReferenceException may be thrown
- Confused about the DapperIdentityCryptography HOT 1
- Implement IQueryable<TUser> Users
- Environment.OSVersion.get is deprecated
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 identity.dapper.