View create-azure-vm-in-selected-subscription-powershell.ps1
# 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
# 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
{
"Version": 1.0,
"Codecs": [
{
"KeyFrameInterval": "00:00:02",
"H264Layers": [
{
"Profile": "Auto",
"Level": "auto",
"Bitrate": 1000,
View Azure media services transcoding JobState.Error handling
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
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
## 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
// Entity Framework
public ActionResult GetBokaroStudentEF()
{
var db = GetFromDbContext();
var data = db.Students.Where(i => i.City == "Bokaro");
return View(data);
}
// LINQ
public ActionResult GetBokaroStudentLINQ()
View MVC with Abhimanyu Kumar Vatsa.md
View AngularJS CRUD in MVC Sample Demo
Step 1. Install AngularJS using install-package angularjs or using NuGet Package Manager
Step 2. Insert JS code references on web page or _Layout.cshtml page
<script src="~/Scripts/jquery-1.11.1.min.js"></script>
<script src="~/Scripts/angular.min.js"></script>
<script src="~/Scripts/AngularImp/EnquiryService.js"></script>
<script src="~/Scripts/AngularImp/EnquiryCtrl.js"></script>
Step 3. Create View Page as given below
View Default.aspx
<script>
function SaveMember() {
var ID = document.getElementById('<%=hfID.ClientID %>').value;
var OrderStatus = document.getElementById('<%=ddlOrderStatus.ClientID %>').value;
var PaymentStatus = document.getElementById('<%=ddlPaymentStatus.ClientID %>').value;
var DispatchDateTime = document.getElementById('<%=txtDispatchDateTime.ClientID %>').value;
var CourierCompany = document.getElementById('<%=ddlCourierCompany.ClientID %>').value;
var ConsignmentNumber = document.getElementById('<%=txtConsignmentNumber.ClientID %>').value;
var DeliveryDetails = document.getElementById('<%=txtDeliveryDetails.ClientID %>').value;
var Status = document.getElementById('<%=ddlStatus.ClientID %>').value;