I've got only client side Metadatstore:
initialize = (metadataStore) => {
metadataStore.addEntityType({
shortName: "AppsListHelper",
namespace: NFL.settings.entityNamespace,
dataProperties: {
Path: { dataType: "String" },
Title: { dataType: "String", isPartOfKey: true },
Author: { dataType: "String" },
Description: { dataType: "String" },
ImageUrl: { dataType: "String" },
IsFavourite: { dataType: "Boolean" },
AppTypeName: { dataType: "String", isPartOfKey: true },
Departments: { dataType: "String" },
AlwaysShownTo: { dataType: "String" },
AvailableTo: { dataType: "String" },
HasAccess: { dataType: "Boolean" },
Keywords: { dataType: "String" }
}
});
metadataStore.registerEntityTypeCtor('AppsListHelper', function () { this.IsMyApp = ko.observable(false); });
}
I want to add additional property 'IsMyApp' only for client side usage - in one of my GET method I set this property to 'true':
querySucceded = (data) => {
ko.utils.arrayForEach(data.results, (item: m_application.Application) => {
item.IsMyApp(true);
});
return this.apps(data.results);
}
Now I try to query local data via breeze manager, using query:
private getLocal = (resource) => {
var query = this.EntityQuery.from(resource).where('IsMyApp', '==', 'true').toType("AppsListHelper");
return this.breezeManager.executeQueryLocally(query);
}
but nothing happens (view is loaded but is blank), after remove line for 'where clause' it returns all data.
Any help will be appreciate :)
My more detailed scenario is as follow: I have 2 views: 'My Apps' and 'All Apps'. Since all entities are the same type 'AppsListHelper', after I received both lists with data from the server they are cached toogether - that caused same data being displayed on two views (its understood for me) when pulled from local cache. So as first solution I wanted to add additional flag 'IsMyApp' only on client side since I really don't need it on a server and distinguish data based on value of this flag for appropriate view.