View script-identity.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN TRANSACTION; | |
GO | |
CREATE TABLE [AspNetRoles] ( | |
[Id] nvarchar(450) NOT NULL, | |
[Name] nvarchar(256) NULL, | |
[NormalizedName] nvarchar(256) NULL, | |
[ConcurrencyStamp] nvarchar(max) NULL, | |
CONSTRAINT [PK_AspNetRoles] PRIMARY KEY ([Id]) | |
); |
View Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.EntityFrameworkCore; | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.Linq; | |
namespace ConsoleApp4 | |
{ | |
class Program | |
{ |
View example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select class="form-control" @onchange="ChangeMessageFilter"> | |
<option value="---" selected=@(Filter.Message == "---")>---</option> | |
<option value="Request" selected=@(Filter.Message == "Request")>Request</option> | |
<option value="Response" selected=@(Filter.Message == "Response")>Response</option> | |
</select> |
View appsettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Key": { | |
"Type": "Store", | |
"StoreName": "My", | |
"StoreLocation": "CurrentUser", | |
"Name": "CN=SUBJECT_NAME" | |
} |
View appsettings.development.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"IdentityServer": { | |
"Key": { | |
"Type": "Development" | |
} | |
} |
View script-2012.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [master] | |
GO | |
/****** Object: Database [ValuesDB] Script Date: 16-Jul-20 10:45:22 PM ******/ | |
CREATE DATABASE [ValuesDB] | |
CONTAINMENT = NONE | |
ON PRIMARY | |
( NAME = N'ValuesDB', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\ValuesDB.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB ) | |
LOG ON | |
( NAME = N'ValuesDB_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\ValuesDB_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB ) | |
GO |
View PeliculasController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
peliculasQueryable = peliculasQueryable.OrderByDescending(x => x.VotosPelicula.Average(y => y.Voto)); |
View Startup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); | |
services.AddDbContext<ApplicationDbContext>((serviceProvider, dbContextBuilder) => | |
{ | |
var connectionStringPlaceHolder = Configuration.GetConnectionString("PlaceHolderConnection"); | |
var httpContextAccessor = serviceProvider.GetRequiredService<IHttpContextAccessor>(); | |
var dbName = httpContextAccessor.HttpContext.Request.Headers["tenantId"].First(); | |
var connectionString = connectionStringPlaceHolder.Replace("{dbName}", dbName); | |
dbContextBuilder.UseSqlServer(connectionString); | |
}); |
View appsettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"ConnectionStrings": { | |
"PlaceHolderConnection": "Data Source=.;Initial Catalog={dbName};Integrated Security=True", | |
} | |
... |
View startup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddDbContext<ApplicationDbContext>(options => | |
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection") | |
)); |
NewerOlder