All Questions
714
questions
0
votes
1
answer
59
views
Entity Framework Core : Include not working for many-to-many relationship
I'm having trouble with .Include() not working for many-to-many relationships in Entity Framework Core. My setup works fine for one-to-many relationships, but the related entities are not being loaded ...
0
votes
1
answer
91
views
Does EF Core load all properties of an entity before loading the entities in .Include?
I have an entity for which I have property that's dependent on a virtual member. While loading the entity, I am getting the virtual member as null even though I have included it in .Include.
My entity ...
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 ...
0
votes
1
answer
178
views
Strange performance issue with Where and Endswith, 7 times slower with .NET 8 than with .NET Framework
I discovered a strange performance issue with the following statement, after upgrading the solution from .NET Framework to .NET 8, I've got performance degradation about 7 times slower.
I'm iterating ...
0
votes
1
answer
57
views
Filter duplicates using unknown columns
public async Task<dynamic> GetDuplicants(params string[] selectedColumns)
{
var parameter = Expression.Parameter(typeof(Applicant), "x");
var properties = selectedColumns....
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; }
...
0
votes
1
answer
59
views
MongoDB .NET Driver - Update field in nested sub array document
I have a document like this:
{
"_id" : UUID("f599b3fa-4c10-42ae-b9cd-b329aafa266b"),
"Title" : "Prod 1",
"Variants" : [
{
...
0
votes
0
answers
35
views
Return values based on LINQ query C# for multiple tables [duplicate]
Table 1: Main
Table 2: SubMain
Table 3: jnMainSubMain
Main table records
MainId
MainContent
isRemoved
1
Hello
false
2
Hii
false
SubMain table records
SubMainId
SearchId
isRemoved
1
123
false
2
...
0
votes
3
answers
69
views
In C# how do you transform a list of records into an indefinite amount of hierarchy levels?
We are currently receiving a list of accounts that have an optional parent account id. When ingesting the data we realized that the parent-child relationship isn't as simple as we thought. We're ...
-1
votes
1
answer
98
views
The expression 'x' is invalid inside an 'Include' operation
I am working on a dotnet core project where I am using repository pattern and using the repositories inside a mediator handler.
I have a one method inside a repository which return multiple records ...
0
votes
1
answer
60
views
.NET Core / EF Core Linq - get entities with certain level of nesting
Let's say I have these 3 models:
MainModel -> contains a collection of ModelA and a collection of ModelB.
ModelA -> contains a collection of ModelA and a collection of ModelB.
ModelB -> ...
1
vote
0
answers
137
views
How to group data and build a stacked barchart with C# and Blazor ApexCharts?
I am using Blazor with Blazor Apex Charts to make charts for the dashboard I am working on.
Now I have run into a bit of a problem.
The web-app is period based. By that i mean its only showing data ...
-1
votes
1
answer
39
views
Unable to update database entity using linq
var receiptDetailRecord = (from BcchildDetails in _context. BcchildDetails
//...
select new SubmitReceiptModel
{ ...
0
votes
1
answer
103
views
In LINQ how to check all fields of a inner list in a list with all fields of a inner list in another list?
This is my model:
class A
{
public string Value { get; set; }
public int? bId { get; set; }
public B b { get; set; }
}
class B
{
public int Id { get; set; }
public List<A> ...
0
votes
1
answer
78
views
Same EF Core query with the same data set and different result in every run
I have very weird issue below is a service which called by controller, it's returning different result without any change on passed parameter or on the data set
so for example in first run it shows me ...