Skip to main content

All Questions

Tagged with
-1 votes
1 answer
61 views

LINQ query where clause in list

I am trying to limit the data returned via a repository using the where clause based on a list of values. I have a PurchaseOrders entity where I want to return all purchase orders that have an ...
michael's user avatar
  • 35
0 votes
0 answers
32 views

FilterDefinitions to Lambda Expression<Func<TEntity, bool>> conversion - DataGrid

I am using MudBlazor Datagrid, and populating the data using ServerData. Here I get the list of filters, sorts from GridState object, which are in ICollection. I am using a Repository and UnitOfWork ...
Agraj Agranayak's user avatar
-2 votes
1 answer
60 views

How to convert this Linq to lambda expression (Introducing the online converter) [closed]

Do you know any software or online web application or a tool in Visual Studio that can do this conversion? And please someone help me, I can't convert this complex (to Linq Like This : From x in ...
YaSecu's user avatar
  • 95
0 votes
1 answer
85 views

C# Linq All in Where condition

I had the following LinqExpression: var results = _localDatabase.Table<ArticleData>().Where(article => article.ArticleName!.ToLower().Contains(searchQuery.ToLower()); Which had the ...
Benehmb's user avatar
  • 17
0 votes
0 answers
40 views

Assigning the result of a MethodInfo to a Property to work with Entity Framework

My target is to do a more dynamic and object-oriented entity-framework database-request. So I wrote a class like this: class Target { [MapFrom(nameof(GetSum))] public int Sum { get; set; } ...
Matthias Burger's user avatar
-1 votes
1 answer
99 views

OrderBy with lambda?

I have following function to generate a table shown in the output screenshot. I want to modify this function to get desired output shown below but I am not very familiar with C#. If I pass years array ...
Ugur Catak's user avatar
0 votes
1 answer
66 views

Expression.Call on array with a custom function

I have a list of items, I want ,via expression, to filter out the items using my own custom function. Something like this return Items.Where(Foo) private static bool Foo(Item item) { item.Name.Equals(&...
styx's user avatar
  • 1,902
0 votes
1 answer
30 views

How do I sort by a condition, then make the top result of the first the top of a different sort?

So i was wondering if I could sort sortTarget = storeList .OrderByDescending(x => x.edited_date ?? x.created_date) .Select(y => new SortTarget { Id = y.id, store = y.store}) ....
Aroueterra's user avatar
0 votes
1 answer
107 views

Create Expression working with Entity Framework out of a string

For a table with paging using Entity Framework I want to create simple classes that will generate an Expression-Tree, that maps to EF entities. Also, I want EF to just fetch the columns that are ...
Matthias Burger's user avatar
0 votes
1 answer
86 views

Find, Group and Merge Overlapping Date Time ranges to determine "full range"

Apologies for some of the terminology. This is a difficult problem to explain. I am trying to determine the actual time in a dataset with records containing duplicate and overlapping date time ranges. ...
Dean's user avatar
  • 21
0 votes
0 answers
78 views

is it possible to convert lambda function to string for use in system.linq.dynamic.core expression

I mean to convert something like: query = query.Where(it => it.Color.Contains("blue")); // to @"Color contains "blue"" or query = query.Where(it => it.Color....
mz1378's user avatar
  • 2,420
1 vote
4 answers
600 views

SQLite cannot apply aggregate operator 'Sum' on expressions of type 'decimal'. Using LINQ to Objects to aggregate the results on the client side

Running the following code, there is an error in the OrdersPrice=g. Sum (p=>p.TotalPrice) line, Why? I want to query the sales data of the corresponding Managers for Orders within the past month, ...
Mr. Luo's user avatar
  • 41
0 votes
2 answers
133 views

LINQ group a list and exclude groups that contain a record with a field value

Having trouble setting up my lamda to exlude groups with a record that has a field with a value. My data example: CTY ProcId ProcTyp ProcDate ZZZ 23-015 INIT 2023-01-26T20:04:30 ZZZ 23-015 UPDATE ...
sinDizzy's user avatar
  • 1,324
0 votes
3 answers
70 views

Trying to figure out a c# linq for the list of objects which can be tagged with multiple categories. Get the category with the associated objects

list of entities tagged categories entity1 (cat1, cat2, cat3) entity2 (cat2, cat4, cat5) entity3 (cat1, cat3, cat5) entity4 (cat2, cat3) entity5 (cat1, cat4, cat5) Class Entity { ...
cshaprcoder101's user avatar
0 votes
2 answers
79 views

In Linq, How to get list of parents that their children have a special age and other childern remove too?

I have two models: Parent and Child public class Parent { public int ID { get; set; } public string Name{ get; set; } public virtual ICollection Children { get; set; } } public class ...
NedaM's user avatar
  • 113

15 30 50 per page
1
2 3 4 5
254