Hey,
I have been playing with the new LINQ stuff in a project for the last day, I must say that it is really cool. coolj.
I am using v2.6.8.606 with SQL Server 2005.
Here are two queries that I have so far.
var e = from s in metaData.Sample
where (s.Request.RequestNumber == requestNumber(txtSample.Text))
select s.Suffix;
var p = from m in metaData.ProjectSample
where (m.ParentProjectSampleId.Value == projectSampleId)
orderby m.Name ascending
select new
{
Name = m.Name,
};
In the query for e, the s.Suffix is a string that will be something like "S4", "P1" etc.
Now in the second query I need to concat to fields and check that the concat'd field is not in the first query.
I tried adding the Concat function mapping from the help and with some help from the forums but I keep getting an exception:
SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryConstructionException: The operand of the Contains method can't be converted to an entity or a query
This is what I tried adding to the where clause of the second query:
(!e.Contains(CustomFunction.Concat(m.ProjectSampleType.Suffix, m.Instance)))
m.ProjectSampleType.Suffix is a string which will be something like "S" or "P" and m.Instance is an int that will be something like "4" or "1".
Many thanks in advance from a LINQ noob.
PS. I'm timing you, and go...