What type of extension methods would you like to see for IOrganizationService / ServiceClient? #335
Replies: 4 comments
-
Thanks for you feedback and recommendation @jordimontana82 , That said, we are considering a new set of extensions based on internal and external feedback from the community that we would like to provide as separate packages in conjunction with other work being done in PAC CLI. Also, we have consider adding an interface to the ServiceClient directly to help folks Mocking the client and intended to provide such an interface as part of the DI work we are doing with it. It would be helpful if you could tell us which of the existing extensions you are using to help inform future decisions. |
Beta Was this translation helpful? Give feedback.
-
Thank you @MattB-msft !
Looking forward to that interface!
Several orgs using the latest version of FakeXrmEasy were using several methods on the ServiceClient that do not exist in IOrgService* interfaces. I don't have the details of which ones yet, but will get back to you |
Beta Was this translation helpful? Give feedback.
-
Hi @MattB-msft, I have an update on this. These would be methods like CloseIncident or CloseOpportunity. They have a fair bit of logic which I suppose it makes it easier to use them directly (i.e. CloseOpportunity is in charge of calling several messages depending on the status code). I suppose these are one of the messages you're considering moving to dedicated extension packages (i.e. messages for Sales in package, and so on)? For example, only devs who work on an implementation that have the Sales app would need access to this functionality...) |
Beta Was this translation helpful? Give feedback.
-
I am going to move this over to the Discussions area... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi !
I've seen many extension methods against the ServiceClient class which have business logic, like the following
Most of them seem follow the same pattern, they reset the last error and make sure the client is not null, then perform some logic.
Could maybe these extension methods refactored into a a common place so they could be then be used as IOrganizationService* extension methods?
This would allow us who do heavy unit testing and that we rely mostly on the interfaces for mocking not having to depend on the client to use these methods, and would allow us to use them on the server side too (plugins etc).
Beta Was this translation helpful? Give feedback.
All reactions