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

match columns have to be properties of the TEntity class #149

Open
mweel1 opened this issue Jun 3, 2023 · 1 comment
Open

match columns have to be properties of the TEntity class #149

mweel1 opened this issue Jun 3, 2023 · 1 comment

Comments

@mweel1
Copy link

mweel1 commented Jun 3, 2023

Getting this error when trying to use the library

var p = new Product() { ProductName = request.ProductName, ProductDescription = request.ProductDescription };

        await _context.Product.Upsert(p)
            .On(w => w.Id == request.Id)
            .WhenMatched(w => p)
            .RunAsync(cancellationToken);
@vbessolitsyn
Copy link

Hi, you should use Entity properties instead of comparison in '.On' expression.
In your example it should be just: .On(w => w.Id).
Also expression in .WhenMatched should be like 'x => new YourEntity()', your line will throw error. But in your case you can just omit it.

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