All Questions
2,844
questions
0
votes
0
answers
28
views
Use some kind of helper function In EF Select query to make subquery [duplicate]
I have several tables that handles different kinds of translations for my entities and those tables to linked via relations to other entities.
I use subquery to directly access translations tables ...
1
vote
2
answers
120
views
Multiple tables query with repository pattern
I have an ASP.NET Web API project, and have implemented repository and unitOfWork patterns.
I currently have a big SQL query that I want to implement in code, it includes a lot of tables and joins.
My ...
1
vote
1
answer
56
views
Join tables based on StartsWith function
I have two tables to join. The joining condition is a column that should be like or starts with the other column, not exactly equal. How to do that in Linq? This is my function:
public async Task<...
0
votes
0
answers
34
views
Entity Framework Core not recognising mapped user-defined function
I'm using Entity Framework Core with .NET 8 and trying to call a user-defined function from C# code.
I'm following the instructions here but have a slightly different use case. Rather than having the ...
0
votes
2
answers
113
views
Why isn't searching on an indexed column faster than a string comparison?
I was asked for a demonstration of how searching on an indexed column is faster than searching for a string prefix, so I created a quick test but the results were surprising and I can't see why.
The ...
2
votes
1
answer
31
views
Syntax to call a parameterized function in Entity Framework with one of the parameter being INTERVAL
I have a call in Entity Framework like this:
// storageConfiguration and retentionPolicy are some models
string storageId = storageConfiguration.StorageId;
int retentionDays = retentionPolicy....
0
votes
0
answers
41
views
Overriding identity tables properties / columns in EF Core 8 has no effect
I'm overriding the IdentityRole / IdentityClaim, etc.
However, I've noticed that some of these fields has no effect either in Fluent API or via attributes.
Class that overrides IdentityRole<Guid>...
0
votes
2
answers
66
views
How do I do an inner GroupJoin on dotnet?
I'm using .NET 6 with Entity Framework. This is my situation:
I have a BenefitEntity (with Name and Description properties and a relationship with BenefitCategory) and this BenefitCategory which has ...
0
votes
1
answer
75
views
How to ignore trailing whitespace? [duplicate]
Say a SQL table contains a column of char(10), and a record contains the value "ABC" in that column. Entity Framework will pass ABC ("ABC" with 7 trailing spaces) when asked ...
1
vote
1
answer
198
views
Converting System.String to System.Guid
I'm currently having a bit of a problem trying to convert a string with guid behaviour inside my database to convert to an actual Guid in my application. I have tried a lot of things, which currently ...
-1
votes
2
answers
112
views
Query (or LINQ in Entity Framework) for getting user's rank
I have a SQL Server database with a table named Users.
This table has 2 columns: XP (int32) and Name (nvarchar).
I need a SQL query or Linq (this is better because I'm using Entity Framework in C#) ...
0
votes
0
answers
37
views
How to move photo path from database to image editor in c#?
On the Web Desktop App
I print the personnel information in my database into the datagrid. I can bring the required fields dynamically with focusedrowchange. As I bring the information, I want to ...
0
votes
1
answer
92
views
EF Core: Navigation property not loading related entities despite Include
I'm encountering an issue with Entity Framework Core where a navigation property is not being populated, even though I'm using the Include method.
Relevant code:
FileRepository:
public IEnumerable<...
0
votes
1
answer
96
views
Return multiple count from linq query
I have two arrays of strings with champion names in request. I want to calculate wins and loses for matches where one team contains champions from request.TeamChampionNames and other team contains ...
0
votes
0
answers
52
views
Trying to save an item from a dropdown display list in a string, in my C# web app
I've been trying to teach myself C# and am currently trying to make a "Truck Quality Test" data storage / display app. I'm using standard VS MVC web app with Razor and Entity for SQL.
I'm ...