|
|||||
|
Login while Disconnected |
Post Reply
|
| Author | ||
mlens
Newbie
Joined: Apr-19-2010 Location: Australia Posts: 7 |
Post Options
Quote Reply
Topic: Login while DisconnectedPosted: May-25-2010 at 10:44pm |
|
|
Hi there,
VS2008 Silverlight 3 We've implemented IEntityLoginManager which works as expected while connected. Problem is we need to provide a login mechanism for users when disconnected. What we were hoping to achieve was; 1. Attempt to login Asychronously 2. If login fails due to being disconnected, attempt to authenticate the user credentials against Entity Manager cache. (The manager is loaded at startup with an IsolatedStorageFile if it exists). Problem is, once you implement IEntityLoginManager, you can no longer query the cache unless first logged in? (We think) Is there a way to work disconnected once IEntityLoginManager is implemented? Thanks |
||
![]() |
||
GregD
IdeaBlade Joined: May-09-2007 Posts: 374 |
Post Options
Quote Reply
Posted: May-26-2010 at 2:06pm |
|
|
It is the EntityServer to which you are denied access if not logged in. You can query the cache.
|
||
![]() |
||
mlens
Newbie
Joined: Apr-19-2010 Location: Australia Posts: 7 |
Post Options
Quote Reply
Posted: May-26-2010 at 4:11pm |
|
|
Thanks Greg for the answer. That is what I thought I was doing with the following statements;
IEntityQuery<User> qry = _manager.Users.Where(u => u.LogonName == LoginName); qry.QueryStrategy = QueryStrategy.CacheOnly; IEnumerable users = qry.Execute(); However, users only returns records when the application has successfully logged on. Am I querying the cache incorrectly? Regards |
||
![]() |
||
GregD
IdeaBlade Joined: May-09-2007 Posts: 374 |
Post Options
Quote Reply
Posted: May-28-2010 at 12:56pm |
|
|
mlens:
Are you sure you have some User entities in the cache when you run your query? i just tested a cache-only query using the following method (having previously saved some Employees to the Data.bin file):
LoginManagerRequired was set to true in the exe project's app.config. LoginManager as follows:
Login() is called in this LoginManager if DevForce tries to access the EntityServer. (You can verify this by substituting the version of the query with no call to With(QueryStrategy.CacheOnly). It throws an exception.) The above test method, in the form shown, successfully reports 9 Employees in the list. |
||
![]() |
||
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You can vote in polls in this forum |