Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Conditions with attribute comparison

See original GitHub issue

When attempting to build a condition comparing to another attribute as the documentation shows, like this:

var candidate = ...
var scopeWrite = Transact.UpdateItem<JobScope>()
  .WithPrimaryKey(pk, sk)
  .WithCondition(Condition<JobScope>.OnSizeOf(js => js.Jobs).LessThan(js => js.MaxJobs))
  .On(js => js.Jobs).Insert(new HashSet<string> { candidate });

the LessThan method gives a compile error:

error CS1660: Cannot convert lambda expression to type 'Expression' because it is not a delegate type

Am I doing something wrong? The parameter is of type Expression - should this be Expression<Func<TEntity, TProperty>>?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

brian-imaginelearningcommented, Nov 1, 2021

@firenero - no problem, done.

firenerocommented, Oct 31, 2021

@briananderton-il This one seems unrelated to the original API issue. And I can’t easily reproduce it. Do you mind creating a separate issue and providing some code for me to reproduce?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Attribute to Attribute Comparison
Use attribute to attribute comparison to compare the contact's values in two data fields to determine whether to admit the contact.
Read more >
Condition - Amazon DynamoDB
A comparator for evaluating attributes. For example, equals, greater than, less than, etc. The following comparison operators are available:.
Read more >
php - Result of an if condition comparing a single variable ...
I have found that attributes() produces an array of attribute names and their corresponding values. The if statement above clearly is interested ...
Read more >
Compare Attribute with Attribute | CIMPLICITY 10 ...
Expression block which compares two attributes. If the attributes meet the comparison criteria, then the condition evaluates to true.
Read more >
Using Attribute Conditions (Sun Identity Manager ...
Attribute conditions are commonly used to select the subset of objects that match certain criteria. ... Operator (a kind of check or comparison...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found