We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a model, that has it's DbSet in DbContext
public class Human : Identifiable { [Attr("name")] [StringLength(128)] public string Name { get; set; } [Attr("second-name")] [StringLength(128)] public string SecondName{ get; set; } }
I have a JsonApiController, where PatchAsync method is overriden:
public class PeopleController : JsonApiController<Human> { public PeopleController( IJsonApiContext json_api_context, IResourceService<Human> resource_service, ILoggerFactory logger_factory, : base(json_api_context, resource_service) {} // Patch method: [HttpPatch("{id}")] public async override Task<IActionResult> PatchAsync(int id, [FromBody]Human human) { human.SecondName = "Some Second Name"; return base.PatchAsync(id, human); } }
The problem is: This operation
"human.SecondName = "Some Second Name"
doesnt affect state of "human" object, we even can return base method like this:
"return base.PatchAsync(id, new Human());"
or
"return base.PatchAsync(id, null);"
the final changes in database will be taken from initial state of entity(that was taken exactly from request)
}
The text was updated successfully, but these errors were encountered:
This problem is described in #536 and also describes a work around.
This issue will be tackled in v4 in a more elegant way.
Let me know if the other issue has enough instructions for you to work around the issue.
Sorry, something went wrong.
No branches or pull requests
Description
I have a model, that has it's DbSet in DbContext
I have a JsonApiController, where PatchAsync method is overriden:
The problem is:
This operation
"human.SecondName = "Some Second Name"
doesnt affect state of "human" object, we even can return base method like this:
"return base.PatchAsync(id, new Human());"
or
"return base.PatchAsync(id, null);"
the final changes in database will be taken from initial state of entity(that was taken exactly from request)
}
Environment
The text was updated successfully, but these errors were encountered: