Skip to content

Custom API Version Format

Chris Martinez edited this page Jan 9, 2023 · 1 revision

It is now possible to extend or change the provided API version format, but that capability comes with several rules:

  1. You must extend ApiVersion
  2. You must override:
    • GetHashCode
    • CompareTo
    • ToString(string,IFormatProvider)
  3. You must implement IApiVersionParser
    • It may be possible to extend ApiVersionParser depending on your requirements

You will likely need to extend ApiVersionFormatProvider or implement a custom IFormatProvider. Although not strictly required, you may want to implement operator overloads for your custom type to retain functional parity with ApiVersion. The custom parser will need to be passed to components that accept IApiVersionParser and/or replace the default implementation registered for dependency injection.

You should consider the impact that a custom API version may have on clients. Your custom format and parsing logic may need to be distributed to them for to use.

Clone this wiki locally
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy