Skip to main content

All Questions

-2 votes
1 answer
113 views

How to use query with quotes inside a parent query [closed]

I have a use case, where I need to update column value which is itself a query. Table structure: CREATE TABLE MyTable ( ID int, Query varchar(max) ) Update query: UPDATE MyTable SET Query =...
shuja ali's user avatar
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 ...
user3408420's user avatar
0 votes
2 answers
73 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 ...
Raso's user avatar
  • 71
0 votes
1 answer
37 views

SQL to Linq conversion with SYSDATETIMEOFFSET

Could someone assist me in converting following sql query to LINQ? Important part of this one is to be able to convert the date to a UTC date (with daylight savings). SELECT a.id, b.id FROM ...
saif's user avatar
  • 400
0 votes
0 answers
36 views

Fetch all data with their column using EF and raw query without creating model classes

I am coding an application for myself (kinda like a phpMyAdmin interface) where I have an input/text that's gonna send a query to the backend (I am using EF and MySQL with Xampp). With this raw query (...
trgjk yfojn's user avatar
0 votes
0 answers
180 views

SQL exception catcher in Entity Framework 6

I need to catch a SQL exception when executing a query in Entity Framework 6. In EF Core, there is a DbCommandInterceptor and its method CommandFailed(DbCommand, CommandErrorEventData) for this. Does ...
swaggoo's user avatar
  • 47
0 votes
1 answer
53 views

EF 6 Update query and Where clause with list of integers comparison

In EF 6.0 I want to update some records based on a WHERE filter. Records which I recognize from a list of integers of ids. The problem is it sees the id list as an nvarchar "61, 62, 63" and ...
Mihai Socaciu's user avatar
0 votes
0 answers
44 views

Store object that has a List of objects as a property, without these objects generating a seperate table

I have this class that has 2 complex properties: public class App { [Key] public Guid Id { get; set; } public string StringId { get; set; } = string.Empty; public string AppName { get; ...
Nono-Man's user avatar
1 vote
1 answer
463 views

EF Core: Sort table based on List of int that corresponds with a column in that table

I have a list: List<int> ids = new List<int>(){ 1, 2, 3 } And a table TableA. I have an IQueryable<TableA>, which is not enumerated. TableA has an column named Id. I want to order ...
oysandvik's user avatar
0 votes
1 answer
397 views

How do I insert nested objects correctly in Ef

I had a problem trying to add object from dto. I have a DTO like this public class CustomerCourseSessionDto : IDto { public int Id { get; set; } public int? ConnectorId { get; set; } ...
Uğur Han Atılgan's user avatar
0 votes
0 answers
17 views

IDs are incremented by omitting some of them

I have an API in written in NET 6 and a MSSQL database. Because I use Entity Framework as context, I have a table with migrations where (i don't know if matter, but just to be said) All tables (api ...
AlleXyS's user avatar
  • 2,588
0 votes
1 answer
122 views

Tables having one to many relationship generates outer join

I have 2 tables public class Department : DbContext { public int DeptId {get; set;} public string DeptName {get; set;} public virtual List<Student> Students {get; set;} } public class ...
csharp newbie's user avatar
-1 votes
3 answers
55 views

Indexing on product table's Column (itemId)

I want to do indexing on product table's column i.e ItemId. product's table primary key is Id. by default primary key i.e Id is clusted index I want to do indexing in one column i.e itemId the images ...
MusaDotNet's user avatar
0 votes
1 answer
294 views

Entity Framework 6 How to make a subquery

code: int companiesId = context.Users.Where(x => x.Id == UserId).Select(x => x.Companies.Id).FirstOrDefault(); tasksList1 = context.Tasks.Where(x => x.User.Companies.Id == ...
BTicaret BTicaret's user avatar
2 votes
0 answers
2k views

Entity Framework .net 6.0 Sql Query Cant find

I want to run the sp in the database. but sql query gives reference error. It doesn't suggest anything as a using instead. code: var allUsersAndCountry = context.Database.SqlQuery<ListTaskViewModel&...
BTicaret BTicaret's user avatar

15 30 50 per page
1
2 3 4 5
26