grandchamp / Identity.Dapper

Identity package that uses Dapper instead EntityFramework for use with .NET Core
MIT License
268 stars 62 forks source link

Use typeconverter #87

Closed ervwalter closed 5 years ago

ervwalter commented 5 years ago

When using a key type of Guid with Identity.Dapper, UserManager.FindByIdAsync does not work because Convert.ChangeType can't convert a string to a Guid.

This pull request adds support for TypeConverters (for which there are many built in, including for Guid). If a valid TypeConverter is not found, it falls back on the existing Convert.ChangeType call.

grandchamp commented 5 years ago

That is pretty cool! I didn't know about TypeDescriptor class.