CreateRef - link is null
Open
@KenitoInc is already working on this.
Since Apr 12, 2022.
followup
- Dominant language
- C#
- Stars
- 505
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Description
"link" parameter is null when CreateRef is called
Assemblies affected
Microsoft.AspNetCore.OData 8.0.8
Reproduce steps
public class A
{
[Key]
public int Id { get; set; }
public B B { get; set; }
}
public class B
{
[Key]
public int Id { get; set; }
public string Value { get; set; }
}
builder.EntitySet<A>("TestAs");
builder.EntitySet<B>("TestBs");
public class TestAsController : ODataController
{
[AcceptVerbs("POST", "PUT")]
public ActionResult CreateRef([FromODataUri] int key, string navigationProperty, [FromBody] Uri link)
{
return Accepted();
}
}
http://localhost:52769/api/TestAs(1)/B/$ref
{"@odata.id":"http://localhost:52769/api/TestBs(2)"}
Expected result
key == 1, navigationProperty == "B", link == [link to B entity]
Actual result
key == 1, navigationProperty == "B", link == null
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.