Ok, done the (AppUser) casting, so code is:=
AppUserEntity toReturn = null;
RelationPredicateBucket filter = new RelationPredicateBucket();
filter.PredicateExpression.Add( AppUserFields.LoginId == userId );
filter.PredicateExpression.Add( AppUserFields.Password == password );
DataAccessAdapter adapter = new DataAccessAdapter();
toReturn = (AppUserEntity)adapter.FetchNewEntity(new AppUserEntityFactory(), filter);
//bool ValidLogin = (toReturn.IsNew == false );
adapter.CloseConnection();
But while the FetchNewEntity method instantiates a new AppUserEntityFactory, it still bombs with:-
An unhandled exception of type 'System.InvalidCastException' occurred in sd.llblgen.pro.ormsupportclasses.net11.dll
Additional information: Specified cast is not valid.
What are we missing here?. Desparately need to clear this "brick wall" to make some progress. Yes I should have spotted the casting in the docs, but nothing in the docs indicates the above is incorrect.
Stack trace below.
'DefaultDomain': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded.
'PL': Loaded 'c:\MidOffice\PL\bin\Debug\PL.exe', Symbols loaded.
'PL.exe': Loaded 'c:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll', No symbols loaded.
'PL.exe': Loaded 'c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No symbols loaded.
'PL.exe': Loaded 'c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll', No symbols loaded.
'PL.exe': Loaded 'c:\midoffice\pl\bin\debug\bl.dll', Symbols loaded.
'PL.exe': Loaded 'c:\midoffice\pl\bin\debug\yatra.dal.dll', Symbols loaded.
'PL.exe': Loaded 'c:\midoffice\pl\bin\debug\sd.llblgen.pro.ormsupportclasses.net11.dll', No symbols loaded.
'PL.exe': Loaded 'c:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll', No symbols loaded.
'PL.exe': Loaded 'c:\midoffice\pl\bin\debug\sd.llblgen.pro.ormsupportclasses.cf11.dll', No symbols loaded.
'PL.exe': Loaded 'c:\midoffice\pl\bin\debug\yatra.daldbspecific.dll', Symbols loaded.
'PL.exe': Loaded 'c:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll', No symbols loaded.
'PL.exe': Loaded 'c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll', No symbols loaded.
An unhandled exception of type 'System.InvalidCastException' occurred in sd.llblgen.pro.ormsupportclasses.net11.dll
Additional information: Specified cast is not valid.
The program '[2456] PL.exe' has exited with code 0 (0x0).