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
If I need to access another repository within a DetailViewModel.
How should I do this? I could not find a code snippet for that.
I have tried to resolve the repository from the current container. But GetAll() always returns 0 records.
Kind regards,
Fabian
I need more information so that I can assist you further.
Yes I try to access the Web API with intersoft Entity Data Model.I have registered the repository and resolve it within the ViewModel.
Count will always be 0. But the table contains record.
var secondRepository = Container.Current.Resolve<ISecondRepository>(); var entires = secondRepository.GetAll().Count;
What steps do I have do proceed to register and use the repositories?
secondRepository.GetAllAsync() is working.
Why does only the async version return the correct result?
You are using LocalEntityRepository. To query data, you can use one of the available methods as follows:
Note that whenever you retrieve data, the entity will be stored in an EntityContainer in the repository. This allows the EntityContainer to track any changes that happens to your entity so that you can easily send the changes back to the enterprise data service.
For more detail, please check Repository Pattern article in Crosslight documentation.
What GetAll() do is:
public virtual ICollection<TEntity> GetAll() { return this.EntityContainer.FindEntities<TEntity>(FindEntityState.All) .Where(o => o.EntityAspect.EntityState != EntityState.Deleted).ToList(); }
It gets all items using default select parameter from EntityContainer.
The source can be obtained from the git repository.
Hope this help.
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