Skip to content

AsObject<T> on 5.21.0 throws MappingFailedException, did the behaviour change? #805

@XzaR90

Description

@XzaR90

Describe the bug
Neo4j.Driver.Mapping.MappingFailedException: 'Cannot map record to type X because the record does not contain a value for the property 'Y'.'

Did the behaviour change?

To Reproduce
Use AsObject on a class where returned type is camelcase and property is pascalcase

    public class MapperConfiguration : IMappingProvider
    {
        public void CreateMappers(IMappingRegistry registry)
        {
            registry
                .RegisterMapping<X>(
                    mb =>
                    {
                        mb.UseDefaultMapping();
                        mb.Map(m => m.Y, "y");
                    });
        }
    }

RecordObjectMapping.RegisterProvider<MapperConfiguration>();

Expected behavior
It should map camelcase to pascalcase but not other way around and it should not matter if the property does not exists on the back-end side or it should be a optional configuration at least a option to disable it.

Version Info (please complete the following information):

  • .NET Version: .NET 8
  • .NET Driver Version 5.21.0
  • Neo4j Server Version & Edition 5.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions