Skip to content

Which types are supported?

Mogens Heller Grabe edited this page Jan 25, 2017 · 7 revisions

Out-of-the-box you can have properties with the following well-known .NET types:

  • bool => SqlDbType.Bit
  • byte => SqlDbType.TinyInt
  • short => SqlDbType.SmallInt
  • int => SqlDbType.Int
  • long => SqlDbType.BigInt
  • float => SqlDbType.Decimal
  • double => SqlDbType.Decimal
  • decimal => SqlDbType.Decimal
  • string => SqlDbType.NVarChar
  • DateTime => SqlDbType.DateTime
  • DateTimeOffset => SqlDbType.DateTimeOffset
  • Guid => SqlDbType.UniqueIdentifier

👌

If you need anything besides these types, you can create an implementation of IDebaserMapper that ▶️roundtrips◀️ values of your custom type and hook the mapper in to your model by decorating the property with [DebaserMapper(typeof(YourCustomMapper))]. You can read more about this mechanism on the How to support custom types page.

Clone this wiki locally