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

DataMapperAttributeResolverTask does not run Setup method on the resolved data mapper #380

Open
Krusen opened this issue May 29, 2019 · 2 comments

Comments

@Krusen
Copy link
Contributor

Krusen commented May 29, 2019

As the title says the Setup() method is not invoked on the resolved data mapper when using the DataMapperAttribute to specify a data mapper directly on a property.

This causes AbstractDataMapper.Configuration property to never be set, which results in NullReferenceExceptions in most cases.

@mikeedwards83
Copy link
Owner

Can you give me an example of a model with the DataMapperAttribute?

@Krusen
Copy link
Contributor Author

Krusen commented Jul 30, 2019

public class StubClass
{
    [DataMapper(typeof(StubMapper))]
    public string StubMapperProperty { get; set; }
}

public class StubMapper : AbstractDataMapper
{
    // This is not invoked
    public override void Setup(DataMapperResolverArgs args)
    {
        base.Setup(args);
    }
}

It should also be pretty clear from the PR #381 with the new unit test.

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

No branches or pull requests

2 participants