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

update No mapping to a relational type can be found for the CLR type 'CancellationToken'. #18

Open
lsczyzkb opened this issue Feb 8, 2018 · 1 comment

Comments

@lsczyzkb
Copy link

lsczyzkb commented Feb 8, 2018

public Task BatchUpdateAsync<TProperty>(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, TProperty>> Property, object value) { return Context.Set<TEntity>().Where(predicate).SetField(Property).WithValue(value).UpdateAsync(); }

error No mapping to a relational type can be found for the CLR type 'CancellationToken'.

@he1a2s0
Copy link

he1a2s0 commented May 25, 2018

The parameters of db.Database.ExecuteSqlCommandAsync(...) in method DefaultLolitaUpdateExecutor.ExecuteAsync(...) are in the wrong order,add a custom class implement ILolitaUpdateExecutor in your project and replace the default DefaultLolitaUpdateExecutor with it can resolve this issue.
Only one different place:
return db.Database.ExecuteSqlCommandAsync(sql, cancellationToken, param);
should be changed to
return db.Database.ExecuteSqlCommandAsync(sql, param, cancellationToken);

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