Search code examples
sitecoresitecore-mvcglass-mapper

How to get null value instead of empty string with Glass Mapper?


I would like to get null value instead of empty string for 'Single-Line Text' field type with Glass Mapper.

I need to recognize if any value was set or if a field was reseted to default state (and I expect there is no value - null).

Do you know if it's possible?


Solution

  • You can try to write a custom Glass.Mapper data handlers.

    Check this post:

    Custom data handlers