• Redux Vs. MVC, Why and How?

    In last two or three years, we started to see the rise of Redux-based (or Unidirectional data flow architecture in general) in the user interface side of the applications, and the slowly decline of MVC based architecture in the UI side.
    What Redux has of advantages over MVC, and what problems it solves? I am going to show what the benefits of Redux over MVC.
    Redux library by itself is not enough to build a whole system, and this is why there is an ecosystem developed around Redux. I am going to show the basic ecosystem needed to build a Redux application, or the essential building blocks of a any redux-based application.

    read more ...
    The proper way to use OAuth in a native app.

    IETF submitted a draft on the best approach to implement OAuth in a mobile native app. They recommended a specific flow and some security considerations.
    I am going to show how to implement these in the code on both mobile platforms iOS, and Android using Facebook authentication service as an example of OAuth provider, and then show how Facebook and Google SDK for those platforms are implementing this apporaches.
    This is not an OAuth tutorial, so I am assuming that you are familiar with OAuth terminologies and workflows.

    read more ...
    Sending emails with attachments or embedded image using Amazon's AWS SES API & .NET.

    To send an email with AWS services, there are two options, either connecting directly to the AWS SMTP server with SMTP protocols, but then you have to open SMTP ports (587 or 25 usually). Otherwise you can use the AWS API which are bunch of REST API services that you can call them over HTTPS.
    AWS SES API has two options to send emails as described in the documentation:

    1. Send simple formatted email:
      which will make your life easy, but you are limited to send only text messages.
    2. Send raw email in order to send an embedded image or more complicated content.

    In order to send raw email with embedded images, you can just find some code on stackoverflow, but I will try in this post to describe what is going on, and how raw email works, so you can understand the process in details.

    read more ...
    Everything you need to know about Date-Time in Asp.NET & JSON.

    Date-Time data type is a complex issue. Complex enough to make you confuse overtime you are writing code that return dates from the web server to the browser.
    ASP.NET MVC 5 and Web API 2 serialize dates differently, which might create more confusion for developers who are using both serializations in one web application.
    I am trying to cover everything you need to know about Date and Date serialization to JSON, in ASP.NET, and what issues are related to them.
    I wanted to cover as well the issues with JavaScript date data type, but I will leave that to another post, because there are tons of issues that can be covered when it comes to JavaScript and date.

    read more ...
    The advantages of IHttpActionResult in Web API 2.

    Web API 2 introduced the new interface IHttpActionResult to return back REST responses, where Web API 1 was using the class HttpResponseMessage to represent HTTP response, and HTTPResponseException to represent HTTP response error.

    IHttpActionResult allows developers to enhance their Web API 1 code to be :

    1. More testable.
    2. More reusable.
    3. Cleaner, and more elegant.

    We are going to unleash the potential of this interface and see some creative ideas on how to use it.

    read more ...