All Questions
1,118
questions
-3
votes
1
answer
43
views
How can I access the properties that are more than one custom type deep? [closed]
C# Beginner here. I have this:
public class Item
{
public int id { get; set; }
public string name { get; set; }
public virtual ICollection<Property> Properties { get; set; }
{
public ...
0
votes
0
answers
23
views
Can you use AJAX in an AWS Lambda/Serverless web page
In the past I've been able to be very creative using AJAX in ASP.Net websites, particularly for Intranet Applications. I've been exploring AWS Lambda/Serverless websites which have a great cost ...
0
votes
2
answers
44
views
filter a list inside a class in .net
I have this class models :
public record AllTransactionsResponse
{
public List<TransactionItem> Item { get; init; }
}
public record TransactionItem
{
public ...
0
votes
0
answers
184
views
.NET 6 PredicateBuilder and Object.GetProperty() not working as expected with Dynamic Property names
I am currently working in WinUI 3 .NET 6 application and needed to implemented a PredicateBuilder as I need to provide dynamic Lambda Conditions based on dynamic property names.
private ...
0
votes
1
answer
74
views
Is there a performance penalty when using a Select() inside a lambda Where() clause?
Stumbled upon something while trying to evaluate which events I need to create.
I had a code like this:
var eventsToBeCreated =
requiredEventDates.Where(d => !events.Select(e => e....
0
votes
1
answer
31
views
Fill the List of Expressions with the class properties based on list of string
There is a class Employee, defined below:
class Employee
{
public int Id { get; set; }
public string Name { get; set; }
public string Address { get; set; }
}
and I need to fill in the ...
0
votes
2
answers
293
views
Invoke async Func stored in a Dictionary
I have a class that is responsible of storing a bunch of async Funcs to execute them later. The signature of each Func differs only on the Task type. Here is the class:
public class FuncStore<...
-1
votes
1
answer
318
views
Combine 2 Lists, List<Expression<Func>> with OR between them and OR/AND between items [duplicate]
I have 2 lists
List<Expression<Func<MyClass, bool>>> andConditions = new List<Expression<Func<MyClass, bool>>>();
List<Expression<Func<MyClass, bool>&...
-1
votes
1
answer
145
views
C# any Lambda Statement as Parameter
I have the following problem: I need to create function which takes any Lambda (with any parameters/return type) as a parameter. For lambda expressions it works fine with this type: LambdaExpression
...
0
votes
1
answer
133
views
merge expressions to use the same lambda parameter [duplicate]
having an array of Expression<Func<T, string>> and a string str
which could have a value like this:
{ m => m.FirstName, m => m.LastName}
I wanted to generate a Lambda expression that ...
-1
votes
1
answer
200
views
Linq query timeout for table
I have many tables that I need to query data to see if a certain parameter(isCorrect) is yes. This field is present in all the tables.
I have built a dynamic query using generic type. But im getting ...
1
vote
1
answer
563
views
.NET Core IQueryable Lambda Memory Leak
I am using a lambda query as below on a column with a Unique index in the table. For each request, approximately 8 -12 kb memory leak occurs.
This method will be called approximately 10-20 times per ...
2
votes
1
answer
216
views
Pass a lambda or an async lambda for execution? Are there tradeoffs? [duplicate]
I'm trying to understand the consequences of two approaches to passing a lambda into an async method that executes the lambda. The below example distills the two approaches. In the first approach, ...
0
votes
1
answer
89
views
How to create a dynamic linq query chained with a or operator from a user input?
The library I used is : Microsoft.EntityFrameworkCore.DynamicLinq
I already managed to do it with an "and" operator, simply by chaining the "Where" in PrepareQuerySearch(Search ...
0
votes
2
answers
51
views
Filter the list based on a list inside
I have this models
public class ModelA {
public int Id { get; set; }
public string Name { get; set; }
public List<ModelB> ModelBClass { get; set; }
}
public class ModelB {
...