Skip to content

Cache, Encryption, Password Generator, Util libraries for .Net

Notifications You must be signed in to change notification settings

zsu/NetApp.Common

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NuGet License: MIT

Features

AES Encryption/Decryption Memory & Distributed Cache Email Service with OAuth2 support Password Generator Common Utilities

NuGet

Install-Package NetApp.Common

Getting started with NetApp.Common

  • Call the followings in Startup:
   services.AddEncryptionService(Configuration.GetValue<string>("Encryption:Key"));
   services.AddCacheManager(options => {
       var redisConnectionstring = GetConnectionString("RedisConnection"); 
       options.RedisCacheOptions.Configuration = redisConnectionstring;
       options.RedisCacheOptions.InstanceName= $"{_env.EnvironmentName}/{Configuration.GetValue<string>("AppSettings:Application:Name")}/";
   });
   services.AddEmailService(options => {
       Configuration.GetSection("Email").Bind(options);
   });
   services.AddPasswordGenerator();
  • appsettings.json
   "Encryption": {
    "Key": "xxxxx" //32 bytes key
  },
  "Email": {
    "Smtp": "",
    "Port": 25,
    "UseSsl": false,
    "Sender": "WebFramework",
    "SenderEmail": "noreply@webframework",
    "UserName": "",
    "Password": "",
    /*"TestEmail":"xxx@xxx",
    "OAuth2":{
        GrantType: "client_credentials",
        ClientId: "xxx",
        ClientSecret: "xxx",
        TokenUri: "https://login.microsoftonline.com/{TenantId}/oauth2/v2.0/token",
        Scopes: "xxx,xxx"
    }*/
  },
  "ConnectionStrings": {
    "RedisConnection":xxx
  }

License

All source code is licensed under MIT license - http://www.opensource.org/licenses/mit-license.php

About

Cache, Encryption, Password Generator, Util libraries for .Net

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages