Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
YouTube Security VideosfreeCodeCamp.org: TimescaleDB Course – PostgreSQL for Time-Series Data(23.09.2026 um 12:30 Uhr)
•
Windows Tipps & SecurityAndroid 17: Rollout auf Samsung-Galaxy-Smartphones verzögert sich(23.09.2026 um 11:42 Uhr)
••
Unix & Linux ServerUSN-8733-2: Gzip vulnerabilities(22.09.2026 um 18:04 Uhr)
••
Sichere ProgrammierungHow to Build Custom PowerPoint Add-Ins for Enterprise Teams(23.09.2026 um 11:25 Uhr)
••
Sichere ProgrammierungSearch Google Jobs in Real-Time with Go and SerpApi 🚀(23.09.2026 um 12:13 Uhr)
•
Sichere ProgrammierungA Psychological State is a Coefficient Vector(23.09.2026 um 12:16 Uhr)
••
YouTube Security VideosfreeCodeCamp.org: TimescaleDB Course – PostgreSQL for Time-Series Data(23.09.2026 um 12:30 Uhr)
•
Windows Tipps & SecurityAndroid 17: Rollout auf Samsung-Galaxy-Smartphones verzögert sich(23.09.2026 um 11:42 Uhr)
••
Unix & Linux ServerUSN-8733-2: Gzip vulnerabilities(22.09.2026 um 18:04 Uhr)
••
Sichere ProgrammierungHow to Build Custom PowerPoint Add-Ins for Enterprise Teams(23.09.2026 um 11:25 Uhr)
••
Sichere ProgrammierungSearch Google Jobs in Real-Time with Go and SerpApi 🚀(23.09.2026 um 12:13 Uhr)
•
Sichere ProgrammierungA Psychological State is a Coefficient Vector(23.09.2026 um 12:16 Uhr)
••
Intelligence View
⚡ tsecurity.de Intelligence

OData Connected Service 0.4.0 Release

OData Connected Service 0.4.0 has been released and is now available on the Visual Studio Marketplace. The new version adds the following features: Support for Visual Studio 2019 (in addition to Visual Studio 2017) Option to generate types…

0
↗ Quelle (devblogs.microsoft.com)
Reagiere als Erste:r — dein Feedback zählt!

OData Connected Service 0.4.0 has been released and is now available on the Visual Studio Marketplace.


The new version adds the following features:


  1. Support for Visual Studio 2019 (in addition to Visual Studio 2017)

  2. Option to generate types as internal so that they are not accessible outside the assembly

  3. Bug fixes

In this article, I would like to take you through some key new features and get you up to speed with using the OData Connected Service.


OData Connected Service in Visual Studio 2019


Let’s start by illustrating how you can use the extension in Visual Studio 2019. Open Visual Studio 2019 and create a new C# .Net Core Console project. Let’s call the project “SampleClient”, and the solution “OCSTest”. Once the project is open, click the Extensions menu, then Manage Extensions. In the Manage Extensions window, search for “OData Connected Service”. Select the extension and install it. You may need to close Visual Studio to allow the extension to install, then restart it after installation completes.


Image OCS 0 4 0 Extensions Download


Alternatively, you can just download the VSIX from the marketplace and double click to install.


Once the extension has been installed. Right-click your project in the solution explorer, then in the context menu select Add > Connected Service. This will open the Connected Services window where you can select which services to add to your project. Select OData Connected Service.


Image Add Connected Service MenuImage Connected Services list 8211 Add OCS


Next, a configuration wizard will open where you can configure how code will be generated for your service.


On the first page, we’ll add the metadata URL of the service we want to access. For this example, let’s use the sample Trip Pin Service. Set the service name to “TripPin Service” and the Address to  https://services.odata.org/TripPinRESTierService/$metadata


Then click Finish.


Image Configure OCS Endpoint


After the process completes, the OData docs website will be launched. Go back to Visual Studio and you will see a connected service added to your project and a Reference.cs file that  contains all the code generated from the OData code generator.


Image Connected Service Added to Project


Let’s proceed to use the generate classes to interact with the service. Replace the code in Program.cs with the following:

using System; 
using System.Threading.Tasks;
using Microsoft.OData.Service.Sample.TrippinInMemory.Models;
static class Program
{
static string serviceUri = "https://services.odata.org/TripPinRESTierService/";
static Container context = new Container(new Uri(serviceUri));
static void Main()
{
ShowPeople().Wait();
}

static async Task ShowPeople()
{
var people = await context.People.ExecuteAsync();
foreach (var person in people)
{
Console.WriteLine(person.FirstName);
}
}
}

The above program fetches people data from the Trip Pin service and then displays their names. If you run the program, it should display a list of names.


Image OData Connected Service app sample people output


To learn more about using the generated client to interact with an OData service, visit this guide.


Generating types as internal


This feature allows you to mark generated types as internal instead of public, so that they are not accessible outside your assembly.


To illustrate this, let’s add a library project to our OCSTest solution. Right-click the solution and click Add > New Project. Create a C# .Net Standard Class Library project and call it SampleLib. This library will expose a simple method that makes use of the same Trip Pin service we used earlier.


Let’s use the same steps as in the previous section to add an OData Connected Service to this project using the same Trip Pin service metadata endpoint.


Next, let’s add a public class to our library project that will contain the method we want to expose to consumers of the library. Let’s name the file LibService.cs. Let’s add the following code in LibService.cs file:

using System;
using System.Threading.Tasks;
using Microsoft.OData.Service.Sample.TrippinInMemory.Models;

namespace SampleLib
{
public static class LibService
{
private static string serviceUri = "https://services.odata.org/TripPinRESTierService/";
private static Container context = new Container(new Uri(serviceUri));

public static async Task<string> GetMostPopularPerson()
{
var person = await context.GetPersonWithMostFriends().GetValueAsync();
return $"{person.FirstName} {person.LastName}";
}
}
}

The GetMostPopularPerson() method simply fetches the person with the most friends from the service and returns that person’s full name.


Let’s add a reference to SampleLib in our initial console applicaton so that we can use it. Right click the SampleClient project > Add > Reference > Projects > Solution > SampleLib then press OK.


Image Add SampleLib reference


At this point, we can call the method from our SampleLib library in the Main method of the SampleClient console app, by adding the following line at the end of the Main method. The Main method should now look like:

static void Main()
{
ShowPeople().Wait();
Console.WriteLine("Most popular: {0}", SampleLib.LibService.GetMostPopularPerson().Result);
}

If you try to run this application, you will get compiler warnings on the Container class, because both the console app and library define classes with the same names in the same namespace. The console app has access to all the proxy classes of the library because they are public. But this is not what we want, we only want to expose the LibService.GetMostPopularPerson() method from the service, the proxy classes should not be accessible outside the library.


To correct this issue, go to the SampleLib project in the solution explorer, under the Connected Services node, you will see a folder for the connected service you added, which is TripPin Service in our example. Right click the folder and select Update Connected Service.


Image Update OCS Menu


This will open up the OData Connected Wizard and allow you to update the configuration. On the Endpoint page click Next to navigate to the Settings page, then click the AdvancedSettings link to reveal more options. Check the Mark generated types as internal checkbox and click Finish.


Image Make types internal OCS option


When asked whether to replace the existing Reference.cs file, click Yes. After the code generation is complete, you can open the generated Reference.cs file and confirm that all top-level classes and enums have an internal access modifier.


Image Generated code with internal modifier


Finally, build and run the SampleClient project, you will not see the warnings again. The program will display the name of the person with most friends at the end.


Image OData Connected Service app sample output with most popular person


Minor updates and bug fixes


The ByKey method now accepts an IDictionary as a parameter as opposed to the concrete Dictionary class that it allowed before. This allows you to pass your own implementation of IDictionary instead of the standard Dictionary when you need to.


In addition, references to EdmxReader have been replaced with Microsoft.OData.Edm.Csdl.CsdlReader. This fixes some of the compilation errors that occurred in the generated code in the previous version.


 


There are more features and fixes coming to OData Connected Service soon, so stay tuned for upcoming releases.


The post OData Connected Service 0.4.0 Release appeared first on OData.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten OData Connected Service 0.4.0 Release

Thematisch verwandte Begriffe: OData, Connected, Service, Release · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-96258 | A vulnerability has been found in onSite internet GmbH Auktion NG Auktio…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger • Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick