odata

Do not allow Expands for specific EntityTypes in Breeze

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 08:37:54
问题 I'm searching for an elegant way to not allow specific EntityTypes to be expanded in BreezeJS. We have a (somewhat) public Web Service that we are exposing, and there are some tables that we don't want to be visible to some consumers of that service. Although we can only expose Web API Methods for those specific tables, consumers of the service could still access those tables by expanding from related tables. Note: I've posted an answer to this question, giving a work-around. However, I'm

CRM dynamics: oData string javascript

这一生的挚爱 提交于 2019-12-11 08:20:00
问题 Imagine two tables: TABLE A |TABLE B Entity |Id Id |name Points |Ranking How to use orderby with $expand: $select=Entity,Id,Points,A_B/name&$orderby=Id asc&$expand=A_B How can i order by Ranking which is from TABLE B? I've tried: $select=Entity,Id,Points,A_B/name,A_B/Ranking&$orderby=A_B/Ranking asc&$expand=A_B Not working It occurs the following error: :: Error : 500: Internal Server Error: The expression 'IIF((Convert(value(Microsoft.Crm.Extensibility

Perform OrderBy on the results of Apply with Aggregate OData Version 4

我只是一个虾纸丫 提交于 2019-12-11 08:05:57
问题 Consider I have an odata query like this: Sessions?$apply=filter(SomeColumn eq 1)/groupby((Application/Name), aggregate(TotalLaunchesCount with sum as Total)) Sessions and Application entities are linked by ApplicationId. I want to apply orderby on "Total" and get top 5 results as odata query response. I tried adding &$top=5 at the end of the above mentioned query. Its says: The query specified in the URI is not valid. Could not find a property named 'Total' on type 'Sessions'. Can anyone

How to lazy load image byte[] into a WPF image control?

亡梦爱人 提交于 2019-12-11 07:59:05
问题 In order to teach myself some basics of OData and MVVM I wrote a little WPF application to query the Employee entity on the Northwind OData service at http://services.odata.org/Northwind/Northwind.svc/ The Model code I wrote to query the Employee entity is below: public static ObservableCollection<Employee> GetEmployeesFromNW() { NorthwindEntities nwEntities = new NorthwindEntities( new Uri("http://services.odata.org/Northwind/Northwind.svc/")); var emp = from e in nwEntities.Employees select

Error in WCF Data Service when using string.Contains within LINQ statement from Silverlight

…衆ロ難τιáo~ 提交于 2019-12-11 07:21:49
问题 This is the code within Silverligh. I'm trying to get data from a wcf data service: public DataServiceQuery<Group> GetGroupsByDisplayName(string groupPartitionKey, string displayName) { DataServiceQuery<Group> query = (DataServiceQuery<Group>)(from g in this.Groups where g.PartitionKey == groupPartitionKey & g.DisplayName.Contains(displayName) == true select g); return query; } This is the result of that query: http://127.0.0.1:8080/DataService/WcfDataService.svc/Groups()?$filter=PartitionKey

PowerShell CRUD with WCF Data Services (OData)?

北慕城南 提交于 2019-12-11 07:07:00
问题 I am trying to perform CRUD against WCF Data Services (OData). The Read portion is pretty well documented across the web… it’s the Create, Update and Delete that I am having trouble with. 回答1: As for the documentation, have you looked at odata.org: http://www.odata.org/developers/protocols/operations#CreatingnewEntries It has a description and samples of all the common CRUD operations against an OData services. You can also write a sample client application using any OData client (for example

Is there a way to alter result of an odata after query is applied and before data is returned?

与世无争的帅哥 提交于 2019-12-11 07:04:15
问题 I have a WebAPI OData controller that I need to do some operation after query applied and before data is returned. In the EnableQuery I can not an extension method to do that. Indeed I need to remove some record before data is returned to client. This operation can not be done via URI/Query/Filter. Update see following code. actual filter is applied on the return value of first ApplyQuery If I do my filter inside it, uri filter is ignore. Code that I tried to see if an extensions exists:

How to add complex properties on a model built with ODataConventionModelBuilder from an EF model

帅比萌擦擦* 提交于 2019-12-11 06:57:41
问题 I have a model that is defined in EF database first edmx. From there I expose some tables and views (mainly views). As it's possible to augment the EF model with OData, how could I add a navigation property of a complex type to another EF and OData exposed type? Currently I define a partial class and add the properties and attributes using them. But it looks like it's possible to add the desired properties with OData's modelbuilder functionality too, or perhaps better yet, first use

Relationship navigation in WCF Data Service with custom (object) data source

試著忘記壹切 提交于 2019-12-11 06:54:04
问题 I have 3 levels of hierarchy in my data: DepartmentList -> EmployeeCollection -> Employee Basically, there are a number departments, each containing a number of employees. Here is my source code: public class DataService : DataService<Departments> public class Departments { private List<Department> _deptCollection; public IQueryable<Department> DeptCollection { get { return this._deptCollection.AsQueryable(); } } ... ... } [DataServiceKey("DepartmentId")] public class Department { public

OData v4.0 aggregate queries (aggregate query syntax)

自古美人都是妖i 提交于 2019-12-11 06:35:42
问题 For example, I have an object model: Product { int ProductId, string Name, List<Sale> Sales } I want to use the aggregate queries to get total Amount of Sales: GET: Product?$apply=groupby(Name, aggregate(Sales(Amount with sum as Total))) (follow as oasis-open standard) --> Got error: UriQueryExpressionParser_CloseParenOrCommaExpected=" ')' or ',' expected at position {0} in '{1}'. ". position at Amount. I change the query to: GET: Product?$apply=groupby(Name, aggregate(Sales/Amount with sum