I am a new LLBLGen Pro user (less than one week) and this is my 2nd
day using LLBLGenProf so I'm sure my problem is a result of something
I'm doing wrong, so any comments would be very welcome!
Yesterday everything seemed to be working great, however I was just
retrieving data using the first code sample below. The SELECT
statement displayed in the tool perfectly each time.
Today if the record I'm looking for isn't found I am inserting it via
the second sample code sample below. I am looking for 3 specific
records in a table, and if any one of them is missing I insert it.
To test my code I delete all 3 records, so I would think the profiler
would display 3 SELECT statements and then 3 INSERT statements. The
problem is, the profiler displays sporadic information such as 1 or 2
of the SELECT statements, but never any of the INSERT statements.
At one point when I was building up my routines I was able to see an
INSERT statement in the profiler, but that was when I was only
building a single record, not checking and then building.
I know this isn't what's happening, but it seems like the profiler
isn't "catching" all the LLBLGen Pro events since my code runs fine.
If I delete 3 records, LLBLGen (and my program) understands they are
missing and builds them with no problems.
Any ideas as to what I'm doing wrong? I'm running LLBL Gen Pro Final
3.0, October 8th, 2010, and LLBLGenProfiler build 742.
Many thanks!
---
// retrieve the data
LinqMetaData metaData = new LinqMetaData(adapter);
var q = from d in metaData.TblDocFolder
where d.Uuid == uuid
select d;
// load the collection
EntityCollection<TblDocFolderEntity> documents =
((ILLBLGenProQuery)q).Execute<EntityCollection<TblDocFolderEntity>
---
// build the missing record
tblDocFolderRecord = new TblDocFolderEntity();
tblDocFolderRecord.Uuid =
fsc.DocFolderAomStatements.Uuid;
tblDocFolderRecord.Name =
fsc.DocFolderAomStatements.Name;
tblDocFolderRecord.Types =
fsc.DocFolderAomStatements.Types;
// setup the database connection
adapter = new
DataAccessAdapter(AomUtility.FileStorDataRepositoryProfile.DatabaseConnectionString,
AomUtility.FileStorDataRepositoryProfile.KeepConnectionOpen,
AomUtility.FileStorDataRepositoryProfile.CatalogNameOverwrites,
AomUtility.FileStorDataRepositoryProfile.SchemaNameOverwrites);
// save the record
adapter.SaveEntity(tblDocFolderRecord);