odata / lab Goto Github PK
View Code? Open in Web Editor NEWThis repository is for exploring new ideas and developing early prototypes of various OData stacks.
License: Other
This repository is for exploring new ideas and developing early prototypes of various OData stacks.
License: Other
I see you’re using the historical generated code, where all the code is placed in a single file. I’m hoping this is just a crawl/walk run implementation. What we’d like to see is each of the model classes placed individually in a .\Models[ServiceName]\ folder.
Notice the Salesforce implementation:
This allows developers to work with these model files directly, not worry about them being overwritten, and you can now do updates, to add additional models as the service expands.
The VSIX for the OData Connected Service can be downloaded and installed in Visual Studio 2017 from here:
https://marketplace.visualstudio.com/items?itemName=laylaliu.ODataConnectedService
Then one can add an OData Connected Service.
When you put in the URL the an Endpoint, that is secured with basic authentication and HTTPS this message is shown:
"Cannot Access"
The connection to the Odata Endpoint should work with Credentials.
During nightly build, code sign the Data feed client for OData v4 and v3.
VSIX targeting Dev14 should be signed with SHA2 instead of SHA1, otherwise it will get the warning message although it could be uploaded into vs gallery
To help developers find what this Connected Service does, you can add links for Supported Technologies:
https://github.com/Microsoft/ConnectedServicesSdkSamples/blob/master/src/UITemplates/SinglePage/Provider.cs
To lab repo.
To readme.md
Using following code to create new record:
var entity = new my_entity(); _crmContext.AddObject('my_entityset_name', entity); _crmContext.SaveChanges();
But enocuntered this error:
"message": "Invalid type for entity id value", "type": "System.ServiceModel.FaultException
1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]",
`
Any suggestion? And when adding new object, how to only send set properties?
I was using this scaffolding for a number of projects I was working on and now after update 3 it no longer appears in the list of "add controller".
Any plans for supporting VS 2017 ? I tried opening the Vsix and changing to version 15, but that didnt work
in the vsix:
WebAPI OData V4 Scaffolding ver. 0.1.2.0
->
OData v4 Web API Scaffolding
The sample Use HttpClient in OData Client in Link http://odata.github.io/odata.net/#04-10-use-httpclient-in-odata-client has problem now?
The samle get no data from server.
Such as:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
https://visualstudiogallery.msdn.microsoft.com/db6b8857-06cc-4f40-95dd-a379f0494f45
The 'Create by' should be Microsoft, similar to: https://visualstudiogallery.msdn.microsoft.com/9b786c0e-79d1-4a50-89a5-125e57475937
In the CRUD documentation I see a deference to the DefaultContainer. I am not sure where that is located. I cannot find it.
Do you plan to add support for Microsoft.OData version 7.x?
To be consistent with Connected Service Provider naming, and to align with the Microsoft specific providers, can you please name your ProviderId Microsoft.OData
Here’s an example of other Provider Ids
Datalogics.PDF.Web
Microsoft.Azure.AD
Microsoft.Azure.MobileServices
Microsoft.Azure.Storage
Microsoft.Office365
Microsoft.Samples.VSOnline
Microsoft.ApplicationInsights
Salesforce.ForceDotCom
With the basic support for groupby and aggregates at the Server ( OData/WebApi#70 ), i think the Client should too be enabled to query those new features.
Actually the Microsoft.OData.Client.dll ( DataServiceQuery ) don't support make those queries.
It throws "An unhandled exception of type 'System.NotSupportedException' occurred in Microsoft.OData.Client.dll - The method 'GroupBy' is not supported".
But if you send the request manually it works.
Ex:
Users.GroupBy(user => user.Login);
as
http://localhost/odata/Users?$apply=groupby((Login));
Run tests in test projects.
Run tests during nightly build, and rolling.
Imagine an entity with many properties of type DataServiceCollection<>. As an example - our File entity has 126 Properties of type DataServiceCollection<>
The auto-generated proxy will do eager initializing (as part of the construction process) of all these properties for each File entity returned from the server during the materialization process even when they are not needed (have not been expanded). The overhead of this is massive and can lead to an OutOfMemory exception when a lot a Files are handled. It is also very time consuming.
If I substitute the eager initialization of all DataServiceCollection<> properties (in the proxy/Reference.cs) with lazy initialization (like: p == null ? p = new DataServiceCollection…) the memory consumption is kept at a more reasonable level and I can handle loads of File objects. The overall time consumption is also significantly lower.
This change does however require changes to DataServicesClient/OData.Client, as it currently would just trigger the lazy initialization during GETs. Se here: OData/odata.net#662
Using the ODATAServiceToSwagger tool with the swagger.io validator (http://online.swagger.io/validator/debug?url={YOUR.swagger.json}) will fail validation. Example response:
[ { "level": "error", "domain": "validation", "keyword": "oneOf", "message": "instance failed to match exactly one schema (matched 0 out of 2)", "schema": { "loadingURI": "http://swagger.io/v2/schema.json#", "pointer": "/definitions/parametersList/items" }, "instance": { "pointer": "/paths/~1AlertTemplates({AlertActionId})/get/parameters/0" } } ]
In particular, this is due to missing the "required" property for pathParameterSubSchema objects
https://visualstudiogallery.msdn.microsoft.com/b343d0eb-6493-44c2-b558-13a0408d013f
'Created by' should be 'Microsoft' similar to: https://visualstudiogallery.msdn.microsoft.com/9b786c0e-79d1-4a50-89a5-125e57475937
support for enum types is a good thing, but looks like without possibility re-use existing enum types from rather than generating new ones it will create headache of casting one enum type another?
having option generating enums like strings would help too.
I have deployed a client application on an environment that requires all connections to be made through a specific http proxy server. How to pass that proxy server details to the OData Client Container?
Hi, OData2Swagger library seems to blow up when I feed the metadata of my service that is still on V1.0. The error I get is from the code below:
EdmxReader.TryParse(XmlReader.Create(metadataURI), out model, out errors);
Exception: "The element 'edmx:Edmx' was unexpected for the root element. The root element should be Edmx."
Did a little bit of digging around it seems this could be because of the namespace change with version v4.
Could you please advise how to make it compliant with previous versions?
We are converting a VS2015 solution using WCF Data Services to VS2017. The web service itself seems to be working fine, but the database model has evolved and we now need to update our OData service reference.
Visual Studio displays an error message, warning us that "The specified OData API cannot be updated because OData APIs are now only supported with Connected Services". We downloaded the connected services extensions available here : https://marketplace.visualstudio.com/items?itemName=laylaliu.ODataConnectedService.
But we can't seem to generate a new OData client for any projet, even a new simple console application. The "OData Connected Service" wizard invariably fails in the "Finish" step with this error message: "Adding OData Connected Service to the project failed: Value cannot be null. Parameter name: path1".
OData Connected Service version: 0.3.0
Visual Studio version: 2017 Enterprise 15.3.3
.NET Framework version: 4.6.1
WCF Data Services versions (server-side):
Here is the $metadata for our service:
$metadata.zip
When installing the Microsoft OData v4 Web API Controller scaffolding they are only showing under C# projects.
I'm sure there are still a lot of VB developers that would like to be able to use the templates.
Hi,
With a Service Reference, it correctly requests a user id and password. With Connected Service I cannot see how to achieve the same result - being prompted for, or fields for storing the user id and password.
Any ideas on how to achieve this now that Service Reference for OData no longer works in VS2017?
Thx, Darrell
p.s. same issue with Connected Service in VS2015.
Create nuget packages for OData v4 data feed client.
I have a large project with many tables to provide common support for.
we have a standard that works with our back end database audit trail that I would like to
automate so that generating a new controller would be closer to our standard.
any chance we can do something to make that possible / easy?
Being shipped by Microsoft, it should be labeled as Microsoft, consistent with the other Microsoft Connected Services
As a developer adds multiple services, the current implementation attempts to replace the same Reference.cs file. Actually, even tho I said [No] the reference.cs file was replaced.
The Connected Service guidance is to name the service folder, specific to the service being consumed. In this case, it would be named Ineta, or Telerik
I'm consuming an OData API where the provider has the following entity as an example, with the namespace changed slightly to hide the providers name.
<EntitySet Name="subject-sets" EntityType="Service.Domain.Models.Projections.SubjectSet">
<NavigationPropertyBinding Path="Tutor1" Target="staff" />
<NavigationPropertyBinding Path="Tutor2" Target="staff" />
<NavigationPropertyBinding Path="Tutor3" Target="staff" />
<NavigationPropertyBinding Path="Pupil" Target="pupils" />
</EntitySet>
This is scaffolded by the OData Connected Service Extension to the following
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")]
[global::Microsoft.OData.Client.OriginalNameAttribute("subject-sets")]
public global::Microsoft.OData.Client.DataServiceQuery<global::Service.Domain.Models.Projections.SubjectSet> Subject-sets
{
get
{
if ((this._Subject-sets == null))
{
this._Subject-sets = base.CreateQuery<global::Service.Domain.Models.Projections.SubjectSet>("subject-sets");
}
return this._Subject-sets;
}
}
which causes issues.
This should instead be converted to either camel_cased or PascalCased
If you have a large model you end up with a very large compiled assembly. This is primarily due to the inclusion of a static string with the emdx in string format. In our scenario (we have around 400 different types) we end up with an assembly ~20MB in size. Simply removing the string version of the model and instead load it runtime reduces our proxy assembly to a more reasonable size of ~2MB.
It would be nice to have an option to exclude the static model and instead inject code for loading it runtime.
Hi,
is there a simple way to have, from Code First Model like:
public class Person
{
[Key]
public string FirstName { get; set; }
[Key]
public string LastName { get; set; }
public int Age { get; set; }
}
the scaffolded Controllers like in your Sample?:
[EnableQuery]
public Person Get([FromODataUri] string firstName, [FromODataUri] string lastName)
{
Person person = _repo.Get(firstName, lastName);
if (person == null)
{
throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
}
return person;
}
Easy on small amount of entities... but large models... uhhh.
https://github.com/OData/ODataSamples/tree/master/WebApi/v4/ODataCompositeKeySample
Kind regards.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.