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

Support for Guid and Enum #801

Open
bar10dr opened this issue May 19, 2024 · 2 comments
Open

Support for Guid and Enum #801

bar10dr opened this issue May 19, 2024 · 2 comments
Labels

Comments

@bar10dr
Copy link

bar10dr commented May 19, 2024

When trying to store an object with a Guid or Enum I get a driver respons that it does not support the types.

From looking around, it seems like in order to use these normal .net types, every user of official neo4j driver has to implement their own cast of these types in order to use them.

Wouldn't it be better if the driver provided this out of the box, so every single user doesn't have to implement their own variation?

If neo4j in the far future perhaps decides to implement these types, if you made the conversion manually or not makes no difference, either you would continue using the conversion to string, or you would have to migrate your data over. It would make no difference if the conversion was built into the driver or not.

At the very least documentation on how to do this would be appreciated.

@thedomeffm
Copy link

I think it is a very important feature that should be provided by the neo4j team.

👍

@thedomeffm
Copy link

thedomeffm commented Sep 12, 2024

I struggle with a mapper for Guids. (#816)

@bar10dr did you got it running?

It seems like i am doing something wrong. MappingFailedException

public class GuidMappingProvider : IMappingProvider
{
    public void CreateMappers(IMappingRegistry registry)
    {
        registry
            .RegisterMapping<Skill>(
                builder =>
                {
                    builder
                        .UseDefaultMapping()
                        // this does not work:
                        .Map(m => m.nodeId, record => Guid.Parse(record.Values["nodeId"].As<string>()))
                        // this also does not work
                        .Map( m => m.nodeId, "nodeId", EntityMappingSource.Property, o => Guid.Parse(o.As<string>()), true)
                    ;
                });
    }
}

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

No branches or pull requests

2 participants