-
Notifications
You must be signed in to change notification settings - Fork 0
mhinze/unbound
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
/* I've traditionally used an extension method like this. blah.ToHttpDictionary() * Pretty useful sometimes. * If you need a custom unbinder, implement ISpecificValueUnbinder and plug it in to the CustomUnbinders. * A custom unbinder would take a specific value from an object - one that your model binding * infrastructure would use to recreate your object. This is used in our system for entities and * enumeration classes. */ public static class UnboundExtension { static UnboundExtension() { SpecificValueUnbinderFactory.CustomBinders = () => new ISpecificValueUnbinder[] { new FooUnbinder(), }; } public static IDictionary<string, string> ToHttpDictionary(this object request, string prefix) { return new Unbinder().Unbind(request, prefix); } }
About
Serialize objects to model bindable dictionary
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published