This file contains hidden or 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
// https://stackoverflow.com/questions/53878000/how-to-migrate-identity-users-from-a-mvc5-app-to-a-asp-net-core-2-2-app | |
/* We need a way to differentiate what users are using the new hash version or not. | |
One way is to add a new property to IdentityUser: | |
*/ | |
using Microsoft.AspNetCore.Identity; | |
public class ApplicationUser: IdentityUser | |
{ |
This file contains hidden or 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
Find: | |
@Html.Partial\(\"(.*)\"\) | |
Replace: | |
<partial Name="$1" /> |
This file contains hidden or 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
Get-ChildItem -Path . -Filter *.cs | Where-Object { $_.Name -match "^\d{14}_.*\.cs" } | Where-Object Name -NotLike "*Designer*"| Select-Object -ExpandProperty Name | Set-Content -path D:\Downloads\migrations.txt |
This file contains hidden or 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
Get-NetConnectionProfile -InterfaceAlias vEthernet* | Set-NetConnectionProfile -NetworkCategory Private |
This file contains hidden or 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
/* | |
* Based on dotnet github issue https://github.com/dotnet/docs/issues/14265 | |
*/ | |
using Microsoft.ML; | |
using Microsoft.ML.Data; | |
using RestaurantViolationsML.Model; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; |
This file contains hidden or 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 PowerShell, find which process is using the port to solve port in use error. | |
$portNumber = 1433 | |
Get-Process -Id (Get-NetTCPConnection -LocalPort $portNumber).OwningProcess |
This file contains hidden or 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
$cnname = read-host -prompt "Input Common distinguished name" | |
if (-Not( $cnname)) { | |
exit | |
} | |
$key = $cnname + ".key" | |
$crt = $cnname + ".crt" | |
$pfx = $cnname + ".pfx" | |
$subj = "/CN=" + $cnname | |
write-host "Create the certificate and private key" |
This file contains hidden or 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
private X509Certificate2 LoadCertificate() | |
{ | |
X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser); | |
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly); | |
//foreach (X509Certificate2 certificate in store.Certificates) | |
//{ | |
// Console.WriteLine(certificate.SubjectName.Name); | |
//} |
This file contains hidden or 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
[Fact] | |
public void InvlaldiModel_ReturnsView(){ | |
var controller = new CheckoutController(); | |
controller.ModelState.AddModelError("a", "ModelErrorA"); | |
var order = new Order(); | |
var result = controller.AddressAndPayment(order); | |
var viewResult = Assert.IsType<ViewResult>(result); | |
Assert.Null(viewResult.ViewName); |
This file contains hidden or 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
<nav> | |
<ul class="nav nav-pills"> | |
<li class="nav-item"> | |
<router-link to="/" class="nav-link" exact-active-class="active" | |
>Home</router-link | |
> | |
</li> | |
<li class="nav-item"> | |
<router-link | |
class="nav-link" |