I have an object like below:
roleNode = //child hierarchyid,
code = model.code,
name = model.name,
created = now,
createdById = Convert.ToInt32(HttpContext.User.FindFirst(CrmClaimTypes.UserId).Value),
updated = now,
updatedById = Convert.ToInt32(HttpContext.User.FindFirst(CrmClaimTypes.UserId).Value),
IsActive = true
My parameters:
{
"parentRoleNode": "1/1/2"
}
How can I create a childNode from parentNode using Entity Framework?
- Note that both "1/1/2" and "1/1/2/1" is available down below at SQL Server Database.
You need to check all your nodes until you find the empty node
Create new view model for your entity and change the type object with your model name