You know that the cookie could be stolen by attackers. As nothing is secure until it's designed to be so, to make your cookie safe, firstly use HTTPS and make it required in your Web.config :
&...
Monday, 28 September 2015
Assume the following enum:
public enum SettingKey
{
APIVersion = 1,
&n...
Sunday, 19 July 2015
The Internet is not all about www (world wide web) that we interact with every day. The web is only one of the most used protocols on the internet. For example, you don’t search on the internet ...
Monday, 06 July 2015
Since releasing Entity Framework code first, I've approximately haven't written any SQL code to Table Migration! I was just thinking about that and tried to add a column to an SQL server table...
Monday, 04 May 2015
Unsafe code in C# is code that can access memory directly, bypassing the normal safety checks provided by the runtime. It is typically used for low-level system programming or for interacting with har...
Monday, 20 April 2015
Recently I faced an issue about the protection of the files which were in a separated Web Application as a CDN. The files would be protected not only from external requests but also the internal unaut...
Tuesday, 10 March 2015
Recently I came up with a solution for filtering the API requests by filtering the server IP. This is used when you want to make the received requests private and secure. It's a simple helper and ...
Monday, 02 March 2015
In C# programming language, to fetch an item from a list or collection, there are some ways. Most of the developers forget to use yield keyword and they create a list and populate it based on a n...
Monday, 16 February 2015
In Asp.net MVC, in order to redirect to an action you can call RedirectToAction(actionName, ControllerName) easily. But if you would have to do it in BaseController, it doesn't work! For example, ...
Sunday, 08 February 2015
In Python, the nonlocal keyword is used to access a variable defined in the nearest enclosing scope that is not the global scope. This means that it allows you to modify a variable that is defined in ...
Sunday, 18 January 2015
I love creating helpers, especially the most used ones. I recently wanted to find the next element of an enum. I created the following static method in a static class:
 ...
Thursday, 31 July 2014
I wonder why there is no method in .Net framework for rounding decimal values as up or down, I've written an extension method for decimal, hope it is helpful for you!
pu...
Saturday, 19 July 2014
In the simplest definition, Any web application that redirects to a URL by a request (querystring) can tamper to an external, malicious URL by hackers. This operation is called an open redirection att...
Monday, 07 July 2014
Suppose that you want to create a LINQ query to filter the users of your database based on bool property. Let's say getting inactivated users. You can create expression for that:
&n...
Monday, 30 June 2014
I was just playing with SQL queries as It's for a long time I haven't write T-SQL code. I came into an error while creating a table via group by. Look at the following piece of code:
...
Monday, 16 June 2014
In asp.net MVC you can submit a form by @using(Html.BeginForm()). You can Post the model you have bound via this operation and command the beginning form to post to a Post action:
@using(Ht...
Monday, 09 June 2014
If you have worked with entity framework for a long time with and LINQ of course, you probably have seen the Error: The entity cannot be constructed in a LINQ to Entities query. So when...
Saturday, 24 May 2014
Polymorphism is an object-oriented programming concept that literally is being in many shapes. polymorphism allows you to define one interface and have multiple implementations. Polymor...
Tuesday, 06 May 2014