Language Integrated Query (LINQ) is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages.
0
votes
0answers
8 views
Retrieving content and all associated properties in Orchard CMS
Is there a good way of programmatically pulling back a list of Content Items from Orchard?
At the moment I'm doing this, which returns a ContentPartRecord and the Title, but it's not pretty by any ...
0
votes
0answers
12 views
Merging a decrypted search of items within a LINQ query
I have the following search query:
IQueryable<File> files = GetFiles(f => f.Clients.Any(fc => fc.Contacts.Any(c => c.Companies.Any(x => x.Name.Contains(searchText)))));
...
1
vote
1answer
38 views
Crafting a LINQ based solution to determine if a set of predicates are satisfied for a pair of collections constrained by a set of invariants
This isn't a question I feel I have the vocabulary to properly express, but I have two collections of the same anonymous type (lets call it 'a.)
'a is defined as new {string Name, int Count}
One of ...
5
votes
4answers
122 views
How can I sort but put zeros at the bottom?
I have a list of objects that have a property Rank. This is an integer.
I want to sort by rank on my view but when i do this:
myObjects = myObjects.Orderby(r=>r.Rank);
i get all of the zeros ...
1
vote
2answers
40 views
How to filter base class collection based on a derived class field?
Let's say I have a collection named MyThings that holds objects of the class Thing and I have a class called ShinyThing which is a derived from Thing, so I do:
MyThings boxWithMyThings = new ...
0
votes
1answer
13 views
What is the Equivalent of ObjectQuery.Parameters in DbQuery
I have code that gets a query using a linq statement making it a DbQuery and not ObjectQuery and I was adding parameters through a foreach loop using that query. but DbQuery has no parameter field. I ...
1
vote
2answers
64 views
Linq - Replace string within a List(of String)
I have the following List(Of String) defined in my program:
MyList:
1Test
2test
3
4Test
5
I would like to remove the word "Test" (regardless of capitalization) from each item in the list if it ...
2
votes
5answers
91 views
If you have a LINQ statement using the Select() method, is there a way to get a value from the next record?
I have the following LINQ statement:
IEnumerable<Statement> statement = bookmarkCollection.AsEnumerable().Select(
bookmark => new Statement()
{
Title = bookmark.Title,
PageNumber = ...
0
votes
2answers
79 views
Where clause not entering lambda
I have the following lambda
var entities = JTransformer.Queryer.GetList()
.Where(x => { var y = JStubs.GetType(x.Name);
return (y.Impliments(baseType) && y.IsGenericType); });
...
0
votes
1answer
20 views
LINQ null reference exception on join
I'm getting a null reference exception for the following linq query:
Dim Report = From Filter In EDTKPDPDescVar _
Group Join EDTK In eDTKBase _
On ...
2
votes
4answers
52 views
String building with particular pattern using char separator
I want to have an string in this format
name1,date1|name2,date2
For that I have written a method
int ifirstStringLength = strFirstStringArray.Length;
int iSecondStringLength = ...
0
votes
1answer
24 views
How to query for columns in EF using a list of column names as string?
Let's say I have a table that I can query with EF + LINQ like this:
var results = dbContext.MyTable.Where(q => q.Flag = true);
Then, I know that if I want to limit the columns returned, I ...
0
votes
0answers
67 views
How do I Implement this Complex Linq Query [closed]
I am working with the following domainservice query:
public IQueryable<YrTotalvw> GetYrTotalsByDate(DateTime begin_Date, DateTime end_Date)
{
var TtlReport = (from r in ...
0
votes
1answer
27 views
Unable to convert MySQL date/time value to System.DateTime with LINQ Where?
I have the statement:
var persons = _context.Persons.AsExpandable()
.Where(predicate).ToList();
When I run the above, it gives me the error Unable to convert ...
0
votes
1answer
44 views
Insert List into XML File
I created an xml file as shown below as well as I have a list of elements that i got using linq query.
public bool createXMLFile()
{
bool myval;
try
...