I have implemented a BOF class as follows, but no matter what I set I cannot get this detected by the probe, and the log error is always:
IdeaBlade.EntityModel.Server |
EntityServer::GetInstanceImplementing |
Unable to locate an implementation of:
IdeaBlade.EntityModel.IEntityServerFetching |
I've even moved this code into a new assembly, included that reference in the web project, added to the <probeAssemblyNames> in web.config (and checked it is picked up by renaming it and I get an error), yet I always get this report in the log file.
Does the class require a specific namespace, must it be static, or what?
Can you please post a working example project so I (and presumably others) can work out how to implement this?
Cheers,
Jason
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using IdeaBlade.EntityModel;
using System.Diagnostics;
using System.Linq.Expressions;
public class BOSFetch : IEntityServerFetching
{
// EXAMPLE:
//void OnFetching(object sender, EntityFetchingEventArgs e)
//{
// if (e.Query.ReturnType == typeof(Product))
// {
// int wholesalerid = GetWhilesalerId(HttpContext.Current.User.Identity.Name);
// iRisk.DataModel.iRiskEntities de = new iRisk.DataModel.iRiskEntities();
// e.Query.Filter = new Filter(p => p.Wholesaler.WholesalerID == wholesalerid);
// }
//}
#region IEntityServerFetching Members
public void OnFetching(EntityServerFetchingEventArgs args)
{
Debug.WriteLine("OnFetching - " + args.Query.ToString());
//((EntityQuery)args.Query).Filter(
////args.Principal.Identity.Name
//if (args.Query.ReturnType == typeof(Portfolio))
//{
// string uname = args.Principal.Identity.Name;
// //var qry = ((IEntityQueryable<Portfolio>)args.Query).Where(p => true); //.Where(p => p.Client.Username == uname);
// //args.Query = (qry as IEntityQuery<Portfolio>);
//}
}
#endregion
}