Am facing an issue with OData Expand. Have basic two entities, one is Parent and the other is Children entity. Relationship between Parent to Child is 1-N.
Also have same mapper for its corresponding dtos. .NetCore APi application has EFcore, automapper. All are of the latest version. Sample is available here at https://github.com/shoguns6/ODataIssue
The issue:
APi works fine if it gets the Parent dto. But the moment i specify the $expand=children in the Api, it gives the ever famous 'Arguments do not match' error.
The expectation: Parent and its children to be retrieved and displayed to user/browser.
Have seen many post related to the same issue and they claim to have given the solution. But with the latest version of all (EFCore, Autommaper, .Netcore) the issue still exist.
Could you please let me what mistake am making here.
Please refer this link. This is a known issue and there is nugget available for the same.
Trick is to effectively define the mapper and use this library https://github.com/AutoMapper/AutoMapper.Extensions.ExpressionMapping/issues/60
Related
I'm trying to grab only properties "id" and "userPrincipalName" from the teacher when getting educationClasses with $expand=teacher as parameter. But whatever I do, I keep getting the full teacher/user object.
https://graph.microsoft.com/v1.0/education/classes?$expand=teachers($select=id,userPrincipalName)
But it gives the same result as this one:
https://graph.microsoft.com/v1.0/education/classes?$expand=teachers
What am I doing wrong?
Or is this one of the endpoints where the expand+select feature is not fully supported? I don't want the full teacher object because it contains assignedLicenses, assignedPlans, provisionedPlans and a whole lot of stuff I will never need in this request.
And...it's production, so I'd like to avoid using the BETA endpoint if possible.
Yep, looks like the underlying AAD storage doesn't support expand plus select.
You can see what is happening under the covers by appending the &$whatif to your query.
Not a lot we can do about this, as the AAD team aren't investing in adding richness here right now.
Our team is leveraging the Sitefinity default REST API (i.e. /api/default/products) in order to perform data operations on an external job. We are able to distinguish products by site/provider and culture without issue. This is currently working for the most part but with a frustrating potential bug.
It seems that the API returns the Live version of the content as expected, but it also returns content of that type that has been Deleted and is sitting in the Recycle Bin. Documentation on this has been scarce and I have not seen it mentioned in other posts. I am looking for a parameter or filter that will remove Deleted/Recycle Bin items from the response in the Sitefinity default REST API?
I opened a support ticket with Telerik/Progress and they confirmed this is a bug. The rep stated that it will be resolved in Sitefinity 11. For now the only workarounds are to make sure items are unpublished before deleted or removed from the recycle bin. Alternatively, one could create their own endpoints that use the ModuleManagers that provide access to the lifecycle of content.
I am trying to query the VSTS OData endpoint from Power BI to get the comments from [Discussion] section inside a Work Item.
It seems that this [Discussion] child entity is not exposed in the data model
(as described here: https://learn.microsoft.com/en-us/vsts/report/extend-analytics/data-model-analytics-service?view=vsts)
Does anyone know if it can be accessed from OData query or in any other way?
P.S.
Another way to do it may potentially be adding a custom text field inside a Work Item and moving all comments there, however, I am not sure if these fields are exposed in OData endpoint as well and can be accessed by means of querying.
I would be really grateful if anyone could share any information on that topic as well.
I'm currently building a mutation that deletes a node.
I looked into the NODE_DELETE mutator configuration, but it specifies it needs a parentName, parentID and connectionName.
Why does deleting a node needs theses fields ? As Relay uses global IDs, it should be fairly easy to delete a node from all connections and/or all fields it is being referenced in.
See the documentation :
Relay NODE_DELETE documentation
Your intuition is correct. Those fields are redundant for the purpose of deleting node from data store, only config.deletedIDFieldName is used during such operation (details in writeRelayUpdatePayload module).
However you can't leave other fields unfilled, because they are still required during validation of your mutation that extends RelayMutation class. I have no idea where this inconsistency comes from, but it's worth noting that Relay team changed the direction of development and RelayMutation will get deprecated.
RelayMutation and fat/tracked queries. Future releases will deprecate
this API in favor of a static mutation API. We recommend using
RelayGraphQLMutation to ease the transition to new mutations.
source: Related issue on github
After quick look in Relay's source it seems this transitional API does not use the old method of configs validation, but I haven't got a chance to experiment with it yet, so you can confirm it yourself.
I have three query against the server. Before each query breeze run "Metadata". Is there a way to run this function only once? I think there is no need for it, because the model hasn't changed.
Without more information, the only reason that i can think that can make breeze to ask for metadata in each query is because you are not reusing the manager and you are creating a new manager for each query.
If that is the reason, you can see this section of the documentation where is explained how to share a single entity manager:
http://www.breezejs.com/documentation/share-entitymanager