Skip to content

Instantly share code, notes, and snippets.

View alexlvovich's full-sized avatar
🎯
Focusing

Alexader Lvovich alexlvovich

🎯
Focusing
View GitHub Profile
@alexlvovich
alexlvovich / hldnew.md
Last active November 30, 2018 15:43
High Level Design For New Project Template

Introduction

Purpose/Audience

Goals and Objectives

Solution overview

System Architecture

Solution Architecture

Service Architecture

Frontend Architecture

Information Architecture

Technology Architecture

/// <summary>
/// Mostly Taken from https://docs.microsoft.com/en-us/dotnet/api/system.net.httprequestheader and wikipedia
/// </summary>
public static class HttpRequestHeaderNames
{
/// <summary>
/// The Accept header, which specifies the MIME types that are acceptable for the response.
/// </summary>
public static string Accept => "Accept";
DECLARE @ApiResourceId INT;
DECLARE @ClientId INT = 6; -- here is your client api which will use local api
-- add api resource for your local api
INSERT [dbo].[ApiResources] ([Enabled], [Name], [DisplayName], [Created], [NonEditable])
VALUES (1, 'apiAuth', 'Auth API', GETDATE(), 0)
SET @ApiResourceId = SCOPE_IDENTITY()
-- insert api scope
@alexlvovich
alexlvovich / gist:4e885ac263bdb14b290078dd5f2be201
Created October 2, 2020 16:47
random string generator with Linq
private static Random random = new Random();
public static string RandomString(int length)
{
    const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    return new string(Enumerable.Repeat(chars, length)
      .Select(s => s[random.Next(s.Length)]).ToArray());
}