How to validate a Code Identifier in C# .NET Framework

Cloudmersive
1 min readJul 14, 2020

--

Who doesn’t love validating code identifiers? Sorry, I couldn’t resist a little sarcasm. To tell you the truth, though, this is not an easy, nor a fun topic. Bearing that in mind, what do you say we just breeze straight through to the results and get everything done in just a few minutes of your precious time? Let us begin.

First we will need to get our package from NuGet:

Install-Package Cloudmersive.APIClient.NET.Validate -Version 3.0.6

Now we can call this function from our library:

using System;using System.Diagnostics;using Cloudmersive.APIClient.NET.Validate.Api;using Cloudmersive.APIClient.NET.Validate.Client;using Cloudmersive.APIClient.NET.Validate.Model;namespace Example{public class NameIdentifierExample{public void main(){// Configure API key authorization: ApikeyConfiguration.Default.AddApiKey("Apikey", "YOUR_API_KEY");// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed// Configuration.Default.AddApiKeyPrefix("Apikey", "Bearer");var apiInstance = new NameApi();var input = new ValidateIdentifierRequest(); // ValidateIdentifierRequest | Identifier validation request informationtry{// Validate a code identifierValidateIdentifierResponse result = apiInstance.NameIdentifier(input);Debug.WriteLine(result);}catch (Exception e){Debug.Print("Exception when calling NameApi.NameIdentifier: " + e.Message );}}}}

And that’s all there is to it, folks!

--

--

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.