pkellner wrote:
So, I've read through the docs (once only) and have started to understand how things fit together, but not very well so please excuse my lack of understanding basic type questions. Maybe this is not a LINQ question, who knows. Couple questions follow:
So, I Created a project and added all my 25 tables as entities. I can successfully query one table as follows:
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.ConnectionString = "Data Source=.;Initial Catalog=svcodecamp ;Persist Security Info=True;User ID=sa ;Password=xxx";
LinqMetaData metaData = new LinqMetaData(adapter);
var q = from data in metaData.CodeCampYear select data;
foreach (var entity in q)
{
Console.WriteLine(entity.CampStartDate);
}
}
I also created a TypedLists by dragging 4 tables to the TypedLists section on the right. I was half expecting that assocaited with metaData I could type the name of my TypedList (metaData.SessionsWithTagsAndAttendees), but my wish was not granted. My question is can you get at this typedList data through LINQ to LLBL?
Not at the moment as in: you can't fetch them with Linq statements. The main reason is that they're datatables and by adding them to metaData, it would make it possible to join with normal entities which would likely cause problems during fetching because for example things wouldn't be joinable at runtime. Typed lists are present since the beginning to give a typed kind of list which was build on top of entities. With linq and typed projections from a set of entities, typed lists have become a bit obsolete, as you can also write the same query in a couple of linq statements and a custom projection.
So v2.6, linq to llblgen pro is limited to entities.
We're looking into generating typed lists as linq queries in the next version.
Second question is around references. I don't fully grock how the references are working. It seems to keep promping me (I"m using resharper) to add references. It currently shows the following references against my small unit test project. (SD.LLBLGen.Pro.LinqSupportClasses.NET35;SD.LLBLGen.Pro.ORMSupportClasses.NET20 and svcodecampDBSpecific). Is this what should have happened? Should I have added these by hand first then all would be good?
Thanks
The generated code projects have the right references in the generated vs.net projects. For your own code, you reference the two generated vs.net projects, SD.LLBLGen.Pro.LinqSupportClasses.NET35 and SD.LLBLGen.Pro.ORMSupportClasses.NET20. You don't need to reference the DQE nor a db provider dll in your own code.