Hello, I premit I'm fair new of Ideablade.... I'm tring to fetch data from a silverlight application with mvvm (cocktail),I've this kind of relation
Dashboard (*) <-> (*) Indicatori (1) -> (*) SNAPSHOT
I'm able to run this query and have the Snapshot taken with include
public OperationResult<IEnumerable<INDICATORI>> GetIndicatoriFromDashboard(int idDashboard, Action<IEnumerable> onSuccess = null, Action<Exception> onFail = null)
{
var q = entityManagerProvider.Manager.INDICATORI.Select(o1 => o1).Include(o1=>o1.SNAPSHOT);
EntityQueryOperation<INDICATORI> op = q.ExecuteAsync();
return op.OnComplete(onSuccess, onFail).AsOperationResult<INDICATORI>();
}
I'm not able to filter on idDashboard since if I do
public OperationResult<IEnumerable<RelatedEntityList<INDICATORI>>> GetIndicatoriFromDashboard(int idDashboard, Action<IEnumerable> onSuccess = null, Action<Exception> onFail = null)
{
var query = entityManagerProvider.Manager.DBOARD.Where(o1 => o1.ID == idDashboard).Select(o1 => o1.INDICATORI).Include("SNAPSHOT");
var q = entityManagerProvider.Manager.INDICATORI.Select(o1 => o1).Include(o1 => o1.SNAPSHOT);
var op = query.ExecuteAsync();
return op.OnComplete(onSuccess, onFail).AsOperationResult();
}
Executing this I got The result type of the query is neither an EntityType nor a CollectionType with an entity element type. An Include path can only be specified for a query with one of these result types.
I've read that include cannot be filtered....but how can I filter from idDashboard? if I were in wpf I would have done a ToList and then split but in sl I must do it async......any help? Thanks
|