queryinterceptor

OData Web API Query Interceptor

ぃ、小莉子 提交于 2019-12-31 06:59:07
问题 OData endpoint is created using ASP.NET Web API 2.0 Trying to create a Query Interceptor in the ODataController like shown in the below code: public class AVMItemController : ODataController { ADWAppContext sampleADW = new ADWAppContext("Server=XXX;Database=XXX;User ID=XXX;password=xxx;Trusted_Connection=false;Encrypt=true"); // GET: odata/AVM [EnableQuery(PageSize=25)] public IQueryable<ADWAppContext.AVMItem> GetAVMItems() { return sampleADW.AVMItems.AsQueryable<ADWAppContext.AVMItem>(); }

Operation instead of query interceptor (WCF Data Services)

大憨熊 提交于 2019-12-12 09:42:20
问题 I was reading about query interceptors. I was disappointed because thats more like a filter instead of an interceptor. In other words you can eather include records or not include them. You are not able to modify records for instance. If I want to create a query interceptor for my entity Users I could then do something like: [QueryInterceptor("Users")] // apply to table users public Expression<Func<User, bool>> UsersOnRead() { return cust => cust.IsDeleted == false; } What if I instead create

Why is IDbCommandTreeInterceptor being skipped on second query?

半城伤御伤魂 提交于 2019-12-11 12:49:22
问题 Using entity framework I have implemented soft delete & data level restriction with IDbCommandTreeInterceptor. For the first query using the context, the interceptor gets hit. But trying again (refreshing browser), the interceptor is skipped. I have checked whether data is being cached by changing some data using SQL server management studio. The changes are reflected but the interceptor is still skipped. What could possibly be causing for this to happen? 回答1: according to the sources

WCF data service permission on individual table columns instead of on whole entities

点点圈 提交于 2019-12-10 11:19:09
问题 Note the bounty is asking about the edited portion of this question. First part is describing the problem I have a table Customer ----- Name Address SocialSecurity Phone Etc.... I have another table called Permissions ----- IdOfUser Can_C_Address Can_R_Address Can_U_Address Can_D_Address Can_C_Phone Can_R_Phone Can_U_Phone Can_D_Phone Etc... note CRUD stands for create, read, update and delete How can I make sure at the server side that a user query the database as: contex.Customers.ToList();

Operation instead of query interceptor (WCF Data Services)

折月煮酒 提交于 2019-12-05 13:29:59
I was reading about query interceptors . I was disappointed because thats more like a filter instead of an interceptor. In other words you can eather include records or not include them. You are not able to modify records for instance. If I want to create a query interceptor for my entity Users I could then do something like: [QueryInterceptor("Users")] // apply to table users public Expression<Func<User, bool>> UsersOnRead() { return cust => cust.IsDeleted == false; } What if I instead create the operation: NOTE IS VERY IMPORTANT TO HAVE THE OPERATION NAME JUST LIKE THE ENTITY NAME OTHERWISE