-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Automapper support #106
Comments
Good to see you're thinking about AM-Support. Would be good if you spin up an "internal" instance of the AM |
@AlexZeitler thanks, well you had something to do with it :-) Do you think it makes sense? Would it satisfy your needs if for example you could register say a generic MappingReadDocument<>, MappingReadDocument<> for handling the default cases, and then register specific closed ones for cases where you need to control the configuration? Or would you prefer a diff approach? |
Gotcha on the internal instance. Would it make sense to allow one to pass in their own instance? |
At the moment I don't see a real advantage of being able to pass in my own instance. Also you could use WRT to On the other hand, as already explained, the key issue for the team (I've been working with as an external) with the Reader / Writer approach is the dependency on CJ inside the controllers. Don't you see scenarios where it makes sense to provide an API serving e.g. CJ and HAL in parallel? |
@AlexZeitler I do see that would be valuable. But document reader and writer are interfaces deliberately. There's no problem having a single class implement both interfaces / be an adapter. I am not a huge fan of the idea of one generic interface to rule them all as I believe it will end up as a leaky abstraction and media types vary greatly. |
What do you think of a base class that provides support for all H-Factors and a concrete impl. maps the factors to the concrete HM type? I think it is difficult to provide the HM generation in a generic manner especially when it comes to linking that requires problem domain context (e.g. paging). |
This is what The Hypermedia Project is attempting (in multiple languages). On Sat Nov 29 2014 at 6:44:40 PM Alexander Zeitler [email protected]
|
@AlexZeitler I am part of The Hypermedia Project because this is something they are focusing on and though I am skeptical, I am willing to be proven wrong. If it turns out I am, I'll gladly be more willing to embrace :-) |
For Web API I've a rough idea how it could be solved using AM and a IoC-Container, but I dunno about Nancy.= |
@AlexZeitler @jchannon has it working currently with my library for Nancy. He wrote Nancy.CollectionJson for this purpose. |
@AlexZeitler you mean how you can solve having the one model to rule them all? |
yes. |
@AlexZeitler well if you look at The Hypermedia Project they already have it. Just hasn't been ported to .NET yet. |
Is HyperMedia project != DotNetHyperMedia project? Do you have a link? |
Not the same. The first has been around for 6 months. It started when a bunch of us were at Api Craft in Chicago. https://github.com/the-hypermedia-project/charter |
I've seen a bunch of feedback from folks (lie @AlexZeitler) feeling it is too painful to have to implement document readers and writers. So I am thinking to just add Automapper support in the box (though possible as an add-on for those that don't want it).
The goal would be to reuse the existing abstractions (reader/writer), but you would have a strongly typed
MappedReadDocument<T>
/MappedWriteDocument<T>
or something.Thoughts on if this is worthwhile / and if so what you'd like to see done? I am definitely NOT the AM expert :-)
The text was updated successfully, but these errors were encountered: