Posts

Showing posts from 2016

Slug URL in MVC

Creating a human friendly URL is one of the important goal in content management system. Recently one developer asked me this question. Like he always sees 'id' in URL in MVC application which is not human friendly. He mentioned stack-overflow example when explaining issue to me, so let’s discuss about this. Open stack-overflow page https://stackoverflow.com/questions/40956081
you will be redirected to https://stackoverflow.com/questions/40956081/runtime-exception-thrown-when-stdvector-destructing
Notice the last part in the query, this is nothing but a slug that is being added in URL all the time. Technically both URL maps to same resource. And in URL number '40956081' is unique identifier.

I hope you know Stack-Overflow is also build using ASP.NET MVC. Let's build similar slug and similar behavior in your MVC application.
First you need to configure your route as give below:
public static void RegisterRoutes(RouteCollection routes) { ro…

Azure Media Service Encoding with custom presets

Image
In this post you will learn how to use custom preset for Azure Media Service Encoding. But before that let's look at a case study or issue which I faced.

When I uploaded a 55.5 MB mp4 file and encoded with "H264AdaptiveBitrateMP4Set720p" encoder preset, I received following output files:


















Look into green rectangular highlighted video files in the image, this looks good according to input file size. But if you look at red rectangular highlighted video files, these are *improved* files for adaptive streaming, which looks useless if you compare with my example "a dark line on my face in video can't be removed by system automatically...make sense". Here I'm trying to understand Azure Media Services encoding permutations but increasing file size 2-3 times larger than input file is never a acceptable deal.

Why I should pay more for bandwidth and storage on these large files, how I convince my clients?

On this issue I thought to understand this from community …

Microsoft MVP: Honored to have received the Microsoft MVP award for the 5th year

Image
MVP Again J 1st July 6:30 PM IST has a very special meaning to me, this day starts with full of expectations and fast heartbeats which lasts until the moment of receiving email from Microsoft. Earlier we had a trick to know renewal status even before official confirmation, but this is that hole is closed ;)
So, once again Microsoft awarded me with the MVP (Most Valuable Professional) award for the 5th time in a row in the Visual Studio and Development Technologies (earlier it was ASP.NET/IIS) category.

I'm honored to be the part of Microsoft MVP Program, this is one of the most prestigious award to me.
Here is the body of the mail that I received:


























I'd like to thanks to my family, all friends, Microsoft Indian MVP Group, Biplab Paul (India MVP Program Lead), Gandharv Rawat and my blog readers and followers.

A very-very special thanks to 👩 who is supporting me every day.
Thanks.

Caching in MVC with Donut Caching - excluding caching login

The main purpose of using caching is to dramatically improve the performance of your application. This is nothing but output caching that means whatever you see is cached, and exact similar things is display to everyone.
I recommend you to read Output Caching in MVC post before you read here, because you should be very careful when using any caching mechanism. Or, if you already know output caching, keep reading here only.
Biggest problem you face
If you display user login status on page which you want to cache, then you need to be careful. With output cache attribute [OutputCache(....)] caches everything on page and it will not exclude caching of some portion like login status.
In the situation, the best caching library you should use is Donut Caching (aka Donut Output Caching). Let’s understand its uses.
Using Donut Caching
The best way to add donut caching to your MVC project is to use the NuGet package. From within Visual Studio, select Tools | Library Package Manager and then choo…

Credential parameter can only be used with Organization ID credentials - Azure Deployment or Continuous Deployment Error

Image
I faced this error while Azure Web App Deployment starts in after Continuous Integration. Here's the detailed information you see in the error:

-Credential parameter can only be used with Organization ID credentials. For more information, please refer to http://go.microsoft.com/fwlink/?linkid=331007&clcid=0x409 for more information about the difference between an organizational account and a Microsoft account. There was an error with the Azure credentials used for deployment.

 Error Screenshot:


If you face this issue, here's quick way:

Step 1

Edit existing build definition and select "Azure Web App Deployment" and then click on "Manage".


Now you will be redirect on new tab.

Step 2

On new tab click on "Update service configuration" and this will open a dialog box where you need to select "Certificate Based" option and then fill up the details. You can click on "Publish settings file" to download, this file will have everything…

Azure media services transcoding JobState.Error handling

Image
In case you are facing error in scheduled transcoding task like the one which I can see on my dashboard (image give below):


You can use below code snippet to get more details about the error:


Here is the output after using above code snippet:



More details here: https://gist.github.com/itorian/4ac5fa723b3d5267258450a2c1a00294

Hope this helps.

Comparing two List to find match in both list, 1st list only, 2nd list only that is Insersect, Minus and Minus Except

Image
In this code snippet post you will learn how to compare two List<T> using lambda expressions. Below code is simple and self-explanatory if you read:

Output:

Moving SQL Azure to local SQL or Azure SQL to VM SQL

Image
There are many requirements like moving database between:

1. SQL Azure to local development SQL Server 2. SQL Azure to Virtual Machine SQL Server 3. Development SQL Server to Production SQL Server 4. Production SQL Server to Development SQL Server

Rename database data files and logical files in SQL Server

When I rename database using SQL Server Management Studio I always change its data files (mdf, ldf) name as well as logical file name of the resource. And this is very common need for SQL Server guy.

Presenting session on "Building BOT on Telegram using C#" in C# Corner's Delhi Chapter

Image
I will be attending C# Corner Delhi Chapter on 7th Feb again. I have attended this event couple of times before. This time I will be presenting Building BOT on Telegram using C#.
Why should you attend my session?

When I want to attend any session, I try to reason myself about why should I attend any particular session. Well, if you are wondering the same for me, here are my reasons for you.
We will have lots of fun learning something completely newThis session will encourage you to think out of the boxOnly OOPS concept is required to attend this sessionThis session will be about BOTThis session will be about AI featuresYou will be able to write your BOT to teach, play, search, broadcast, remind, connect, integrate with other services
Date and time
Date: 7 February 2016 Time: 12:30 PM - 01:30 AM (event with other cool sessions starts at 09:30 AM) Price: Free of cost Where: H-217, First Floor, Sector 63, Noida, India
You should come and join other speaker's session as well starting at 09:30…

Popular posts from this blog

5 Ways to send data between ASP.NET Pages