Skip to main content

Questions tagged [iqueryable]

.NET Framework Interface, providing functionality to evaluate queries against a specific data source wherein the type of the data is not specified.

iqueryable
2 votes
0 answers
59 views

How to convert this SQL query to NHibernate IQueryable query?

I have to create a query similar to the one below to paginate a parent-child query: SELECT v.ProductId, MAX(v.Price) AS Price FROM Variant v GROUP BY v.ProductId ORDER BY Price ASC; I am using C# ...
Mehran Rezaei's user avatar
0 votes
1 answer
63 views

Guidance On How To Approach Reporting for Razor Page Report

I'm not sure where to begin with this one. I have a database table called Trip. In this table, there is the following info on each row of data: TripId ClientName PickUpDateTime PickUpLocation ...
MelB's user avatar
  • 173
0 votes
1 answer
50 views

How to test a method that calls a persistence method returning IQueryable

I read in a few places that it's a good practice for a method that calls the database to return IQueryable because it allows extending queries in services using methods like Select, Where, etc., and ...
capslo's user avatar
  • 45
0 votes
1 answer
32 views

Include in and condition only if property is not null

I am having lambda expression where I am getting record when all the values are equal in input object and db object var matchingrecord = (from data in dbContext.TableA where ...
AMDI's user avatar
  • 963
2 votes
2 answers
113 views

Is it bad to call First() multiple times on an IEnumerable<T> that is actually a List<T>?

I found this method: public async Task SomeMethod(IEnumerable<Member> members) { await DoSomething(members.First()); await DoSomethingElse(members.First()); } It's being called like ...
David Klempfner's user avatar
0 votes
2 answers
91 views

C# LINQ SUM takes longer than expected

I currently testing for a MVC application and found that one of page seems to take longer. By measuring times for each execution of lines by lines, I discovered that one of LINQ line takes more than 5 ...
MAREY's user avatar
  • 51
0 votes
0 answers
14 views

How to create a dyamically lambda expression, to feed a Where.() on a List<CustomClass>

Hello i have a List of this custom class of mine (List<ClassePerLifoFifoGestioneInner>). The class i built like this: public class ClassePerLifoFifoGestioneInner { public int ...
Scvmbi's user avatar
  • 1
0 votes
0 answers
109 views

How do I use Mapster to Project IQueryable

Good day! I am using Entity Framework 6 and .Net Framework 4.8, in which I have the following entity and DTO: namespace Assist.Entity.Model { public partial class procedure_detail { ...
Uncle Ziie's user avatar
1 vote
0 answers
46 views

Querying an entity with property that is converted from List<datetime> to comma separated string. Exception: LINQ expression could not be translated

I am using C# application with Entity Framework version 7.0.4. I have a building entity that one of its properties should be List, I use value converter to save this as comma separated string as the ...
Mohamed Ali Eldin's user avatar
0 votes
0 answers
56 views

Wanted to perform a Join but keep the IQueryable behavior as is

I have a table named ProductIsNotifyMe for Notify Me functionality on ECommerce application, in which columns would be StoreID MemberID Sku (Product) LocationId Unit. Also I have other products ...
Mihir Shah's user avatar
-2 votes
1 answer
173 views

In C# Linq, how to initialize IQueryable or var variable when the type is not known, and linq query returns dynamic fields/object

Original code (no change here) // present code which need not be changed public class StatementHelper { public List<Xyz> GetStatement() { // other code var result1 = (...
AVV's user avatar
  • 171
0 votes
1 answer
884 views

MudDataGrid FilterDefinitions and SortDefinitions in function (ServerData) not working

I have this method to sort and filter dynamically using IQueryiable: GridState<GreenPaperItem> state = null; private async Task<GridData<GreenPaperItem>> LoadData(GridState<...
mz1378's user avatar
  • 2,420
0 votes
0 answers
79 views

Getting The provider for the source 'IQueryable' doesn't implement 'IAsyncQueryProvider' when initializing Test

This is my TestInitialize [TestInitialize] public void SetUp() { _emailSenderService = new Mock<IEmailSenderService>(); _personRepository = new Mock<IPersonRepository>(); ...
Eduardo's user avatar
  • 167
0 votes
1 answer
182 views

Entity Framework Core query only work with .ToList()

I'm using .NET Core 7 and Entity Framework Core 7.0.13 and I have the following query: var test = _context.Set<T> .AsNoTracking() .Include(m => m.MachineOperations! .Where(m =&...
guirms's user avatar
  • 375
0 votes
4 answers
220 views

C# Filter IQueryable with ToString

I have an IQueryable<SomeObject> query which contains a property Value which is a double. I want to filter it by a string that has dot thousands separator comma before decimal (european). I've ...
yyy-t's user avatar
  • 17

15 30 50 per page
1
2 3 4 5
98