iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi support:
in project, I want to use local data . I have tried your mothed which is publiced online:
for the following code:
ILocalStorageService storageService = this.GetService<ILocalStorageService>();
IActivatorService activatorService = this.GetService<IActivatorService>();
var factory = activatorService.CreateInstance<System.Func<string, ISQLiteConnection>>();
the underlined parts is wrong in my project, error info is
Could not resolve type: activatorService.CreateInstance<global::System.Func<string, global::Intersoft.Crosslight.Data.SQLite.ISQLiteConnection>>
How to slove this problme?
Thanks!
Hello Misery,
Make sure you have installed the required Nuget packages, specifically the Microsoft BCL package. To install the package, right click on the Portable project, Manage Nuget Packages. Then look for Microsoft BCL package and install it to your project.
FYI, if you created a new project from Business Template, the Crosslight Project Wizard is already doing the BCL installation automatically. But in case you created a new project from other Crosslight template, then you have to install the BCL package manually to leverage the async/await feature in the Portable project.
Hope this helps.
Please ensure that you have added reference to Intersoft.Crosslight.Data.SQLite assembly in all projects; and add reference of Intersoft.Crosslight.Data.SQLite.[platform] (for example: add reference of Intersoft.Crosslight.Data.SQLite.Android in Android project).
You can also check the documentation: Configuring SQLite for Local Data Storage in here. It discusses things that require attention to use SQLite for local data storage in Crosslight applications.
Hope this help.
About the question I had asked ,thanks very much,it works well now.
by the way, I mat a new problem. that's also about Service Data Access.
// execute the RestRequest
IRestResponse response = await client.ExecuteAsync(request);
The await keyword is invalid.
I have found the same problem on internet:
http://www.intersoftpt.com/Community/Crosslight/IRestResponse-Error-in-ProgramCore/
But I don't kown what the BCL Packages means ? a dll or other things?
It is a packages that enables Visual Studio 2012 (or higher) projects to use the new 'async' and 'await' keywords. For more detail, including how to install the package, please check this link.
Hi :
Now ,the keyword works well. But when I build my project , new problem comes:
Also about that :
error 13 can't wait “System.Threading.Tasks.Task<Intersoft.Crosslight.RestClient.IRestResponse>”
Now,what can i do ?
Hi Misery,
Please make sure that your method is already marked with "async" keyword.
For your reference, please check out our Sync Sample which demonstrate the use of Crosslight SQLite, local data storage, and data synchronization. The sample is already built with data repository pattern which greatly simplify the business logic implementation.
I tried your instance, can run normally, but when I create a new project, and refer to the same DLL, Appear the same mistake again.
my codes:
public SimpleViewModel()
{
this.ShowToastCommand = new DelegateCommand(ShowToast);
}
private async void ShowToast(object parameter)
string baseUrl = "http://www.google.com";
IRestClient client = new RestClient();
client.BaseUrl = baseUrl;
IRestRequest request = new RestRequest(HttpMethod.GET);
IRestResponse response= await client.ExecuteAsync(request);
string mydata = response.Content;
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname