Making Notification Center with Redis Cache

In your web service there is a time you want to let user know that they have got comment on their post, got message, got news etc.  Like ones that I see on top right at Facebook, Twitter.  Today I want to make the same thing using Redis Cache.

In-memory cache is a good choice when it comes to frequently accessed and disposable data.  Redis Cache is even nice that they can store structure data.  For C#ers, you can define data model and just insert up and fetch from cache into the model.

Continue reading “Making Notification Center with Redis Cache”

Mastering Azure Scheduler 1

Hi all. I just want to make my life easier and want my machines to do all of my schedule tasks.  Don’t you?

To manage schedule tasks, the machine has to be on for 24 hours, 7 days a week, and Azure Scheduler offers that service.

This article covers how to manage all schedulers on your account programmatically.

Continue reading “Mastering Azure Scheduler 1”

Localization and bit of SEO

Internet is widely available worldwide no matter what language they may speak.


Then, why not make your website in multi languages?


ASP.Net come with great feature called resource files where you can store key and value per languages and locale (culture) you specify.

The use of resource file is straight forward and easy to implement.  But working with routing feature and making it SEO friendly takes few extra steps


and here is how.

Continue reading “Localization and bit of SEO”

Coding Rule

My memo;

Just so we can have more easy to read code by having coding rules; here is mine.


local and only local variable is usually single letter or very short ones like, a, b, c, x etc.

Input variable names start with lower letter, full name, capital letter if it consist of more than 2 words, like isGood, nameOfFunction.

My own class names are all lower case, even if it is consists of more than 2 words.  Variable inside of classes have Capital letter starting like, City, Name, NameOfFunction etc.




Tips: Designing Views and Using Bootstrap

When you create MVC project with Visual Studio, by default Bootstrap is ready to use.  Bootstrap is mobile friendly CSS, ready to use out of the box. If you are not ultra picky about design, I recommend to use it.  And even if you are, you can still use Bootstrap as a base and make great views.

Here is my memo for design Views.

Bootstrap is mobile first design, so do design in mobile mode first, then create desktop / tablet design using media specific customizes CSS properties.

Example below, if the screen width is more than 768px, then apply this CSS properties, which give 150px padding at top.

for less (and more screen sizes)





Amcharts is one of the best js base chart service out there today.   Amcharts takes JSON data and display all sorts of neat charts.  Here, I am generating JSON data through ASP.Net Web API 2 and show AmCharts graphs.

I followed tutorial document from Amcharts (  This tutorial goes over how to query data from mySQL then generate JSON data then display charts in PHP, but we don’t have to worry about MySQL or PHP, we just create and fetch JSON data from API and goes from there.

First, we will have to know what type of data you want to generate.  We can generalize shape of data we want to work with.  Graphs usually are generated from table of data (or in this case JSON data that fits in table).  If you are to work with 2D graphs, then we will need to generate 2 dimensions of data, x and y. And that’s what we do today.

Let’s start with something simple.  I have system log stored in my DB,  X being time, call it category, Y being some value of some log properties, call it value1 and value2.

Continue reading “ASP.Net Web API 2 and AMCHARTS”

Using Cache in ASP.Net MVC

If you want to make your pages faster to load, you can make use of Cache by using Cache filter.

If you simply want to add Cache capability for a one page, then add

This will give you 120 seconds of cache.

If you want to manage cache for multiple pages, then I recommend creating profiles and manage it at Web.config like below,

then calling these profiles like below;

You can read more detail at :

Trying to get first letter of string in Linq

My error today;

LINQ to Entities does not recognize the method ‘Char get_Chars(Int32)’ method, and this method cannot be translated into a store expression.

I was trying to get list of records that matches fist letter of string.  But I guess it’s not as simple as just

but this worked.