Language Integrated Query (LINQ) is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages.
2
votes
3answers
30 views
Comparing DateTime fields with different 'times'
My program asks for the user to enter a date which is then converted to a datetime:
var fromDate = DateTime.Parse(txtFromDate.Text);
The reason I'm converting it to a DateTime field is because I ...
0
votes
0answers
8 views
LINQ (Jquery) Group BY: return Group Name instead of Indices
I have a query that looks like
var v = (set1.select( s => s.new
{
Text = s.Name,
Value = s.Id,
Group = ...
2
votes
3answers
42 views
Error when using a Linq Expression variable instead of lambda expression directly
I have the following code to get a collection of Types from an Assembly where the Type is a Class:
Assembly assembly = Assembly.LoadFile(DLLFile);
var types = ...
2
votes
1answer
32 views
How does entity framework access associations?
I have two tables, Kittens and Owners in my Entity Framework model. A Kitten has 1 Owner but an Owner can have many Kittens.
I have a repository method called GetKittens() that returns ...
1
vote
4answers
88 views
Linq performance: Any vs. Contains
This question is related to this one, but not entirely the same I think.
Given:
class Foo
{
public string Bar { get; set; }
}
...
var c1 = new List<Foo>() { ... };
var c2 = new ...
0
votes
2answers
12 views
Projecting into KeyValuePair via EF / Linq
I'm trying to load a list of KeyValuePairs from an EF / Linq query like this:
return (from o in context.myTable
select new KeyValuePair<int, string>(o.columnA, o.columnB)).ToList();
My ...
0
votes
0answers
14 views
Linq Left outer join replace null values returned
I am sure this has been discussed before but I read several LINQ left outer join posts and couldn't figure out whether it has been discussed or not. The closest thread that matched what I was looking ...
1
vote
1answer
19 views
linq sub list vb.net, sort by sub value
Its how to working with sub list (in vb.net).
I have a list of Item. each Item contain a list of Item2. I need to sort where Item.ListOf(Item2).value contain "ValueX".
Sample :
Dim myList As New ...
2
votes
2answers
44 views
Linq Groupby, Union and Sum to aggregate data in multiple collections
Introduction
1. I have a class StockVolume it has a property Points, which is of type ObservableCollection<Point>.
public class StockVolume
{
public ...
public ...
0
votes
0answers
26 views
Linq to find duplicates based on specific properties of classes
I have a collection of objects of Class A. I have another collection of objects of Class B. When a user uploads a file, it automatically adds more Class B items to the collection. After the file is ...
1
vote
1answer
25 views
Best way to return list of entities in many-to-many situation
I don't really know how to correctly name this question so feel free to edit.
I have really simple database model that has many-to-many relations between User and UserGroup. Now it works just fine ...
1
vote
2answers
24 views
Linq query to sum by group
I have a data table like this:
Category Description CurrentHours CTDHours
LC1 Cat One 5 0
LC2 Cat Two 6 ...
1
vote
4answers
130 views
Is it possible to .SkipWhile(n => (function)) in linq where (function) looks at the next x rows?
Lets say I have an entity framework object called Measurement. One measurement has many DataPoints and each datapoint has an attribute Length. Say I want to skip the first x datapoints, until the next ...
2
votes
2answers
69 views
Linq - How to select items from a list that contains only items of another list?
I have this two classes:
public class Item
{
public int Id{get;set;}
public List<Test> TestList{get;set;}
}
public class Test
{
public int Id{get;set;}
public Item Item{get;set;}
...
0
votes
2answers
24 views
LINQ join multi table
I have 4 tables:
table1
id1,
fk_tbl2 //this is the foreign key to the "id" in table2
table2
id2,
fk_tbl3 //this is the foreign key to the "id" in table3
table3
id3,
fk_tbl4 //this is the foreign ...