News

A Refreshed OData Client Code Generator

Version 2.0.0, released earlier this month, contains a bevy usability, functionality, and configurability improvements, as well as rounds up a number of bug fixes.

Microsoft's latest release of the OData Client Code Generator was released earlier this month. Version 2.0.0 contains usability, functionality, and configurability improvements, as well as some bug fixes.

OData Client Code Generator is described by Microsoft as an "item template that simplifies the process of accessing OData v4 services by generating C# and VB.Net client-side proxy classes." OData 4 allows developers to create REST-based data services to be published and edited by Web clients using simple HTTP messages. The services are used in conjunction with the OData Client Library for .NET.

Among the usability changes, version 2 has improved exception handling in the code generator and proxy services. It has also redesigned the type of generated class for singletons, from DataServiceQuery<T> to DataServiceQuerySingle<T>. "the generated client side proxy can better support complex queries and support them in a more usable way," blogs the OData Team.

Functionality improvements include: code generator now supports proxy generation that can use metadata documents referenced externally; client-side proxy can reference a locally stored metadata document upon generation; code generator now supports "function imports, action imports, actions & functions bound to collection of entities, actions & functions bound to an entity type."

As for configurability, the OData Team blogs that "a configuration is added to the configuration file "ODataClient.tt" enable the conversion from lower camel case property, entity and namespace names (e.g. "myName") to upper camel case ones (e.g. "MyName"). "

This version also rounds out three key fixes:

  • Generated client code was missing System.Nullable<> for nullable EnumType.
  • A namespace collision occurred due to a missing global:: prefix in some of the global namespaces in generated code.
  • T4 templates appended a trailing slash to the end of the metadata document URI; it's actually the default address for "Metadata as a Service."

OData Client Code Generator 2.0.0 is available through the Visual Studio Gallery here.

About the Author

You Tell 'Em, Readers: If you've read this far, know that Michael Domingo, Visual Studio Magazine Editor in Chief, is here to serve you, dear readers, and wants to get you the information you so richly deserve. What news, content, topics, issues do you want to see covered in Visual Studio Magazine? He's listening at [email protected].

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube