You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicclassSkillRepository{// ...publicasyncTask<Skill>Upsert(Skillskill){/* ... */}publicasyncTask<Skill>GetById(GuidnodeId){StringBuilderqueryBuilder=newStringBuilder("MATCH (skill:Skill {nodeId: $nodeId}) RETURN skill");IList<IRecord>result=await_neo4JDriverService.ExecuteReadQueryAsync(queryBuilder.ToString(),new{nodeId=nodeId.ToString()});RecordObjectMapping.Register(newGuidMapper());// <-- Is this correct?RecordObjectMapping.RegisterProvider(newGuidMappingProvider());// or this..?returnresult.Single().AsObject<Skill>();}}
publicclassGuidMapper:IRecordMapper<Guid>{publicGuidMap(IRecordrecord){// does not work:returnGuid.Parse(record.ToString());}}
publicclassGuidMappingProvider:IMappingProvider{publicvoidCreateMappers(IMappingRegistryregistry){registry.RegisterMapping<Skill>(
builder =>{builder.UseDefaultMapping()// does not work:.Map(m =>m.nodeId, record =>Guid.Parse(record.Values["nodeId"].As<string>()))// does not work:.Map(m =>m.nodeId,"nodeId",EntityMappingSource.Property, o =>Guid.Parse(o.As<string>()),true);});}}
```</div>
The text was updated successfully, but these errors were encountered:
Probably an issue will receive some support..?
Discussed in #816
Originally posted by thedomeffm September 11, 2024
We want to use Guid as our primary key.
This fails because of: MappingFailedException
Cannot map record to type Skill because the record does not contain a value for the property 'nodeId'
.What are we doing wrong?
The text was updated successfully, but these errors were encountered: