View asp-dot-net-identity-to-asp-dot-net-core-identity-migration-script.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
-- STEP 1 : Change name of existing tables | |
EXEC sp_rename 'AspNetRoles', 'AspNetRoles_old'; | |
EXEC sp_rename 'AspNetUserClaims', 'AspNetUserClaims_old'; | |
EXEC sp_rename 'AspNetUserLogins', 'AspNetUserLogins_old'; | |
EXEC sp_rename 'AspNetUserRoles', 'AspNetUserRoles_old'; | |
EXEC sp_rename 'AspNetUsers', 'AspNetUsers_old'; | |
View DevOps-Pipeline-For-Linux-Build
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
# ------------------------------------------------------------------------------ | |
# 1. To build all .net core projects in a solution use below pipeline code | |
# ------------------------------------------------------------------------------ | |
trigger: | |
- master | |
pool: | |
vmImage: 'ubuntu-latest' |
View PayPalRESTAPI.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 System; | |
using System.Text; | |
using System.Net.Http; | |
using Newtonsoft.Json; | |
using System.Collections.Generic; | |
using System.Web.Script.Serialization; | |
namespace ConsoleApp14 | |
{ | |
class Program |
View create-azure-vm-in-selected-subscription-powershell.ps1
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
# Login | |
Login-AzureRmAccount | |
# Set subscription to create resources in | |
Set-AzureRmContext -SubscriptionId "xxxxxxxxx" | |
# Variables for common values | |
$location = "westeurope" | |
$resourceGroup = "demo-resgroup-0" | |
$vmName = "demovm-0" |
View create-azure-vm-powershell.ps1
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
# Login | |
Login-AzureRmAccount | |
# Variables for common values | |
$location = "westeurope" | |
$resourceGroup = "demo-resgroup-0" | |
$vmName = "demovm-0" | |
$publicIP = "spublicip-1" | |
$subnet = "subnet-1" | |
$vnet = "vnet-1" |
View H264MultipleBitrateCustom720p.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
{ | |
"Version": 1.0, | |
"Codecs": [ | |
{ | |
"KeyFrameInterval": "00:00:02", | |
"H264Layers": [ | |
{ | |
"Profile": "Auto", | |
"Level": "auto", | |
"Bitrate": 1000, |
View Azure media services transcoding JobState.Error handling
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
static public IAsset EncodeToAdaptiveBitrateMP4s(IAsset asset, AssetCreationOptions options) | |
{ | |
// Default preset settings | |
//IJob job = _context.Jobs.CreateWithSingleTask(MediaProcessorNames.AzureMediaEncoder, | |
// MediaEncoderTaskPresetStrings.H264AdaptiveBitrateMP4Set720p, | |
// asset, | |
// "Test-Video-" + 100 + "-" + Guid.NewGuid().ToString() + "-Adaptive-Bitrate-MP4", | |
// AssetCreationOptions.None); | |
// Custom preset settings |
View Comparing two List<T> to find match in both list, 1st list only, 2nd list only that is Insersect, Minus and Minus Except
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 ConsoleApplication6 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
List<Items> list1 = new List<Items>(); | |
list1.Add(new Items { name = "abc" }); | |
list1.Add(new Items { name = "abd" }); | |
list1.Add(new Items { name = "aef" }); |
View Exception Filter in MVC
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
## 1. Install log4net using NuGet | |
## 2. Add assembly in AssemblyInfo.cs file | |
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Web.config", Watch = true)] | |
## 3. Add settings in web.config | |
<configuration> | |
<configSections> | |
::: | |
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> |
View EntityFramework vs LINQ vs ADO.NET - select query samples
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
// Entity Framework | |
public ActionResult GetBokaroStudentEF() | |
{ | |
var db = GetFromDbContext(); | |
var data = db.Students.Where(i => i.City == "Bokaro"); | |
return View(data); | |
} | |
// LINQ | |
public ActionResult GetBokaroStudentLINQ() |
NewerOlder