c# - Operation instead of query interceptor (WCF Data Services) -
I was reading about it, I was disappointed because it is more like a filter instead of an interceptor, in other words You can not include the record or include them, for example you are not able to modify the record.
If I want to create a query interceptor for my unit Placing this method instead of query interceptor treats my service in the same way, plus I have more power! Is this approach taking a better solution? I will not filter this and a problem navigation properties. Let's say that you have a unit that is called Salespeople, whose client has a link in IEnumberable If you have When you expand your Odata Feed, such as WCFDITA SAC / Sales People / $ $ = Customers will still apply the results for the prescribed results. But it When you run the Audacity query like WCFDataService.svc / client, you will have a filtered list on active customers, but when will it run WCFDataService.svc / SalesPeople? $ Expansion = Fixed results for customers will be included in customers removed. user then I can do something like this:
[query interceptor ("user ")] // Apply expression to table users & lt; Func & lt; User, bool & gt; & Gt; UserAnride () {Return Client = & gt; cust.IsDeleted == Incorrect; } What would happen if I made the operation instead? Note that the operation name is very important, just like the unit name
[WebGet] public IEnumerable & lt; Users & gt; User () {return it back. ContentData source.parts Where (x => x.IsDeleted == incorrect); }
[WebGet] public IQueryable & lt; Customers & gt; Customer () {return.CurrentDataSource.Customers.Where (x => x.IsDeleted == incorrect); }
Comments
Post a Comment