I couldn't get the tests to run due to the missing SQLite DB, but I do have this exact code working in production for a month or so now.
Here are 2 examples for registering converters for properties of a custom object type. Properties of these types on my models map to a string ("ME", "OA", etc.) and a char ('I', 'S', etc.) respectively. In this case, these types descend from the Enumeration class found here: https://github.com/HeadspringLabs/Enumeration/
PocoFactory.RegisterConverterFor(o => QuizAnswerType.FromValue(o.ToString()));
PocoFactory.RegisterConverterFor(o => QuizFeedbackType.FromValue(o.ToString()[0]));
public class QuizAnswerType : Enumeration<QuizAnswerType, string> { ... }
public class QuizFeedbackType : Enumeration<QuizFeedbackType, char> { ... }
The above classes for properties on my models, with the code in this PR, have been working in a production website for over a month now. I hope this is helpful to others.
PR to implement request for issue: https://github.com/sapiens/SqlFu/issues/16
I couldn't get the tests to run due to the missing SQLite DB, but I do have this exact code working in production for a month or so now.
Here are 2 examples for registering converters for properties of a custom object type. Properties of these types on my models map to a string ("ME", "OA", etc.) and a char ('I', 'S', etc.) respectively. In this case, these types descend from the Enumeration class found here: https://github.com/HeadspringLabs/Enumeration/
The above classes for properties on my models, with the code in this PR, have been working in a production website for over a month now. I hope this is helpful to others.