Skip to content
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

POST with nested properties #920

Open
BpStef opened this issue Mar 5, 2024 · 0 comments
Open

POST with nested properties #920

BpStef opened this issue Mar 5, 2024 · 0 comments

Comments

@BpStef
Copy link

BpStef commented Mar 5, 2024

I'm trying to do a POST with the Simple OData Client to my API but when we try to do this I get:
'The property 'Producer' does not exist on type 'Waste.QualificationsCore.API.Interface.OData.Qualifications.QualificationDto'. Make sure to only use property names that are defined by the type or mark the type as open type.'

The code the POST is:
return await _client.For<QualificationDto>(ODataPath(Paths.ODataV1Qualifications)) .Set(request) .InsertEntryAsync(token);

The DTO I'm trying to add is:
` public class QualificationDto
{
[Key]
public Guid QualificationId { get; set; }

	[NonFilterable]
	[NotFilterable]
	public DateTime? DocumentDate { get; set; }

	[NonFilterable]
	[NotFilterable]
	public DateTime? ExpiryDate { get; set; }

	public string IdentificationCode { get; set; }

	[AutoExpand]
	public ProducerDto Producer { get; set; }

}`

The Producer is a reference to an object in another datasource so I want to show it as an seperate object and not an ID. (e.g. Owned type on EF).

How can I fix/do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant