Skip to main content

All Questions

Tagged with
1 vote
1 answer
48 views

LINQ - Left Join with multiple conditions and Is Null operators

I want to write following sql in linq. SELECT COL1, COL2 FROM ( SELECT A.COL1, MAX (NVL (C.COL2, 0)) COL2 FROM TBL1 A LEFT JOIN TBL2 C ON NVL (A.COL4, '') = NVL (C.COL4, NVL (A.COL4, '')) AND NVL (A....
alinz's user avatar
  • 81
0 votes
1 answer
63 views

LINQ join query to two tables with the same model

I have two tables in a database with the same structure. The tables have many columns, the types and names are absolutely the same. Let's say their names are OldTable and NewTable. In my project I ...
Anton Petrov's user avatar
0 votes
0 answers
61 views

Using ToList in GroupJoin cause "could not be translated" error

I'm trying to Join all the replies that fit the condition Replies.ReplyTo == Ticket.Id in a reportInfo object. But when executing the request : Error message: System.InvalidOperationException: The ...
GasTorrent's user avatar
0 votes
0 answers
45 views

Group Join Vs Include Vs Projection queries, what is the difference?

To the best of my knowledges, Group Join vs. Include vs. Projection queries all bring nested entities or should I say hierarchical data - usually for one to many. Also, they all render as a join on ...
ILIIA CHTEREV's user avatar
0 votes
1 answer
36 views

Linq throwing error. The cast to the value type failed

var result = from lfx in m_Context.LabFavoriteXrefs join lfm in m_Context.LabFavoriteMasterEntries on lfx.lab_favorite_id equals lfm.lab_favorite_id into xm from x in xm....
KamalaH's user avatar
  • 1,316
-1 votes
1 answer
119 views

Delegate func in LINQ

I have a problem with optimizing my code). Is it possible to create a method that returns necessary outerKeySelector (i => i.ItemId1, i => i.ItemId2 etc.) as func for Join that depends from ...
A1exZr's user avatar
  • 3
0 votes
1 answer
41 views

Queryable.Join with the WHERE clause using inner table?

I'm trying to use the Queryable.Join method to join Lists of objects together, but I want to use the WHERE clause against the inner table. I cannot reverse the order of the join tables in this case. ...
Eric's user avatar
  • 3,117
0 votes
1 answer
62 views

How to apply joins on different context files

var InsertionId = _DvContext.DvInsertionOrder .Select(x => new { x.Id, x.KiteDealId, x.KiteCampaignId, x.CampaignId }) .ToList(); var camapignId = _kcdbContext.KiteLineitems ...
Sarvjeet Kaur's user avatar
0 votes
0 answers
619 views

EF Core advanced linq join context with c# list

Let's say I have some table named foo and I want to filter out some rows based on a list of id's. var idsList = new List<int> { 1, 4, ..., 9999 } I can't use contains statement due to ...
Kilas's user avatar
  • 174
0 votes
0 answers
49 views

How to apply sort by based on sum while join three table in Linq C#

I have one scenario, I need to implement in linq query. Scenario: Product table: | Id | Name | | --- | ---- | | 1 | ABC | | 2 | MNO | | 3 | FGH | | 4 | YUI | | 5 | IOP | | 6 | RTY | ...
N.Bharath's user avatar
0 votes
1 answer
61 views

Group Sum On Join Query Where One Side Is Empty

I have an order class and shipment class. class Order { public long ID; public decimal ApprovedQuantity {get; set;} } class Shipment { public long OrderID {get; set;} public decimal ...
Mr. A's user avatar
  • 323
1 vote
1 answer
65 views

Contat 2 Lists from different tables into 1 and use AsQueryable()

Attempting to return the below 2 lists into something I can then query against. var people = (from c in _context.FollowingPeople select new Models.Following.FollowingModel { Id ...
Tim Cadieux's user avatar
1 vote
2 answers
415 views

C# Pivot table data into a ViewModel using Linq

I have a use case that contains data stored in a values tables as shown below, that needs to be pivot based on a JobLevel and displayed in a DataGridControl, however in order to get this working I ...
Donald N. Mafa's user avatar
0 votes
3 answers
66 views

SQL join query to LINQ using groupby and order by clause

I am trying to copy this join query into linq..But I don't understand where to add group by and order by statements.. select c.CheckID,cv.Earnings FROM [Customers0].[pay].[...
Ben's user avatar
  • 31
0 votes
2 answers
48 views

How to shorten the Join layers in Dynamic Linq

Whenever you add join a new layer is added and this is difficult to work especially in the where dynamic clause How can I summarize each join with one word I put a query that shows the queries I mean ...
خالد بشير's user avatar

15 30 50 per page
1
2 3 4 5
68