Class NullableDateMapper
Extends NPoco default mapper and ensures that nullable dates are not saved to the database.
Inheritance
object
Namespace: Umbraco.Cms.Infrastructure.Persistence.Mappers
Assembly: Umbraco.Infrastructure.dll
Syntax
public class NullableDateMapper : DefaultMapper
Constructors
View SourceNullableDateMapper()
Declaration
public NullableDateMapper()
Methods
View SourceGetToDbConverter(Type, MemberInfo)
Returns a converter function that transforms a nullable System.DateTime value into a database-compatible value, ensuring that invalid dates (such as System.DateTime.MinValue) are not stored.
Declaration
public override Func<object, object?>? GetToDbConverter(Type destType, MemberInfo sourceMemberInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | destType | The type expected by the database column. |
| MemberInfo | sourceMemberInfo | The reflection metadata for the source member being mapped. |
Returns
| Type | Description |
|---|---|
| Func<object, object> | A function that takes an object (expected to be a nullable System.DateTime) and returns either a valid System.DateTime value or |