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
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) | |
{ | |
using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope()) | |
{ | |
// Seed with integration tests specific data | |
ServerInitialization.InitializeIntegrationTestsDatabase(app.ApplicationServices).Wait(); | |
} | |
app.UseStaticFiles(); | |
app.UseIdentity(); | |
// To log in a user for integration tests |
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 System; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.Filters; | |
namespace Filters | |
{ | |
public class ApiModelStateValidationFilter : IActionFilter | |
{ | |
public void OnActionExecuting(ActionExecutingContext context) | |
{ |
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
$xBimGeometryPackages = Join-Path -Path $env:USERPROFILE -ChildPath "\.nuget\packages\Xbim.Geometry" | |
$latestxBimGeometryPackage32 = Join-Path -Path ((Get-ChildItem -Path $xBimGeometryPackages | Sort-Object Fullname -Descending)[0].FullName) -ChildPath "build\x86\Xbim.Geometry.Engine32.dll" | |
$latestxBimGeometryPackage64 = Join-Path -Path ((Get-ChildItem -Path $xBimGeometryPackages | Sort-Object Fullname -Descending)[0].FullName) -ChildPath "build\x64\Xbim.Geometry.Engine64.dll" | |
if (!(Test-Path "$PSScriptRoot\Dependencies")){ | |
New-Item -ItemType Directory -Path "$PSScriptRoot\Dependencies" | |
} | |
Copy-Item -Path $latestxBimGeometryPackage32 -Destination "$PSScriptRoot\Dependencies\Xbim.Geometry.Engine32.dll" | |
Copy-Item -Path $latestxBimGeometryPackage64 -Destination "$PSScriptRoot\Dependencies\Xbim.Geometry.Engine64.dll" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>NetCoreHeroes</title> | |
<link rel="icon" type="image/png" href="/favicon.png"> | |
<base href="@ViewData["AngularBase"]" /> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> |
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 System; | |
namespace Project.Middleware | |
{ | |
public class BasicAuthenticationHeaderValue | |
{ | |
public BasicAuthenticationHeaderValue(string authenticationHeaderValue) | |
{ | |
if (!string.IsNullOrWhiteSpace(authenticationHeaderValue)) | |
{ |
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
namespace InMemoreCompilation | |
{ | |
public static class CodeGenerator | |
{ | |
public static string GenerateCalculator() | |
{ | |
var calculator = @"namespace Calculator | |
{ | |
public class Calculator | |
{ |
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
param([string]$password) | |
$encrypted = ConvertTo-SecureString $password -AsPlainText -Force | |
ConvertFrom-SecureString $encrypted |
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
Param( | |
[string ]$ProjectDir | |
) | |
get-childitem $ProjectDir -recurse -include *.cs | | |
select -expand fullname | | |
foreach { | |
( Get-Content $_ ) -replace '\[TestMethod\]','[Fact]' ` | |
-replace 'Assert.AreEqual' , 'Assert.Equal' ` | |
-replace 'Assert.AreNotEqual' , 'Assert.NotEqual' ` | |
-replace 'Assert.IsTrue' , 'Assert.True' ` |
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 System; | |
using System.Net.Http; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Moq; | |
using Moq.Protected; | |
namespace Tests | |
{ | |
public class MockHttpClient |
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
$SQLitePackages = Join-Path -Path $env:USERPROFILE -ChildPath "\.nuget\packages\SQLite" | |
$latestSQLite3PackageX64 = Join-Path -Path ((Get-ChildItem -Path $SQLitePackages | Sort-Object Fullname -Descending)[0].FullName) -ChildPath "runtimes\win7-x64\native\sqlite3.dll" | |
$latestSQLite3PackageX86 = Join-Path -Path ((Get-ChildItem -Path $SQLitePackages | Sort-Object Fullname -Descending)[0].FullName) -ChildPath "runtimes\win7-x86\native\sqlite3.dll" | |
if (!(Test-Path "$PSScriptRoot\Dependencies")){ | |
New-Item -ItemType Directory -Path "$PSScriptRoot\Dependencies" | |
} | |
if (!(Test-Path "$PSScriptRoot\Dependencies\x86")){ | |
New-Item -ItemType Directory -Path "$PSScriptRoot\Dependencies\x86" | |
} | |
if (!(Test-Path "$PSScriptRoot\Dependencies\x64")){ |
OlderNewer