Recently started using DA.Net for cross platform projects.
I’m using the Portable Class Library w/ DA LINQ, and everything needs to be Async.
My problem is that when i try to run a Query, the NeedsLogin kicks in but since the login is ALSO async, the query always fails with “Session not found”. Been searching for a sample but no luck.
Thanks for the reply. I tried this approach but i am getting the following error:
Error CS1061: Type RemObjects.DataAbstract.Server.BaseLoginService_AsyncProxy' does not contain a definition forLoginExAsync’ and no extension method LoginExAsync' of typeRemObjects.DataAbstract.Server.BaseLoginService_AsyncProxy’ could be found.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RemObjects.SDK;
using RemObjects.DataAbstract;
using RemObjects.DataAbstract.Linq;
Please check RemObjects.DataAbstract.Async assembly in the references. Add it manually if it is not placed here. This assembly contains LoginExAsync extension method implementation.
Btw, i am using Xamarin but anyway i don’t see that ‘RemObjects.DataAbstract.Async.dll’ in my installation, not in the PortableClassLibrary forlder or the .NET Folder or any of the Mono(xxx) folders.
Sorry for the misunderstanding you. This extension method was added after Spring 2014 release. Please add the next LoginExAsync implementation into your code
public Task<Boolean> LogOnAsync(String userId, String password)
{
return this.LoginExAsync(String.Format(DataModule.ConnectionString, userId, password));
}
public Task<Boolean> LoginExAsync(String loginString)
{
RemObjects.DataAbstract.Server.IBaseLoginService_Async lAsyncService
= (new RemObjects.DataAbstract.Server.BaseLoginService_AsyncProxy(this.fMessage, this.fClientChannel, "LoginService"));
return Task<Boolean>.Factory.FromAsync<String>(lAsyncService.BeginLoginEx, lAsyncService.EndLoginEx, loginString, null);
}