Skip to content

Creates the signature of the entire structure of a type (including all its properties, fields and children)

License

Notifications You must be signed in to change notification settings

askoutaris/type-signature

Repository files navigation

type-signature

Creates the signature of the entire structure of a type (including all its properties, fields and children)

TypeSignature Usage

ITypeScanner typeScanner = new TypeScanner();
IHashGenerator hashGenerator = new SHA512HashGenerator();
ISignatureBuilder signatureBuilder = new SignatureBuilder(typeScanner, hashGenerator);

string signature = signatureBuilder.GetSignature<Person>();

Console.WriteLine($"The signature of type Person is: {signature}");

//The signature of type Person is: b1e38d81d7b812739b0fd09e053a1ecf1936144619e4452ac8633feea6ad41fe

ASP.NET Core

In order to use TypeSignature with ASP.Net Core you have to install TypeSignature.Extensions.DependencyInjection nuget package

public void ConfigureServices(IServiceCollection services)
{
  services.AddTypeSignatureSHA256();
  // or
  services.AddTypeSignatureSHA512();
}

Microsoft Dependency Injection

In order to use TypeSignature with Microsoft Dependency Injection you have to install TypeSignature.Extensions.DependencyInjection nuget package

// setup our DI
var serviceProvider = new ServiceCollection()
  .AddTypeSignatureSHA256()
  .BuildServiceProvider();

// resolve SignatureBuilder
ISignatureBuilder signatureBuilder = serviceProvider.GetService<ISignatureBuilder>();

string signature = signatureBuilder.GetSignature<Person>();

About

Creates the signature of the entire structure of a type (including all its properties, fields and children)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published