Posts

Showing posts from August, 2019

MySQL - Good Habits

In this article, we are going to learn few good habits that we can consider important aspect while work with MySQL to improve performance & troubleshoot as following below: #1 - Do not use stored procedure & function parameters name same as WHERE clause field name It will be responding with all record of query because MySQL interprets field value as parameter value similar like 1=1. Example: -- Bad    CREATE   PROCEDURE  `getPersonById`( IN  id  INT (10))   BEGIN    -- return all record instead    SELECT  id, name   FROM  person  WHERE  id = id;   END    -- Good    CREATE   PROCEDURE  getPersonById( IN  personId  INT (10))   BEGIN    SELECT  id, name   FROM  person  WHERE  id = personId;   END      #2 - Use same data-type in WHERE clause It will be impact on performance because MySQL hold extra memory to type conversion. Example: -- Bad    SELECT   name   FROM  person  WHERE  id =  '1001' ;   -- Good    SELECT   name   FROM  person  WHERE  id = 1001;  

Chat Application using Angular 8, Asp.net Core 2.2.0, Signal R 1.1.0

Image
In this article, we are going to create a simple chat application using Angular 8, Asp.net Core 2.2.0, Signal R 1.1.0 as shown below: We install above all prerequisite following in our development machine: Prerequisite .Net Core SDK 2.2.0  – download from  here . Nodejs 10.15.3  – download from  here . Angular CLI 8.0  – Install angular command package by executing this command: “ npm install -g @angular/cli@8.0.0 ” Setup Asp.net Core with Signal R Project: open a command prompt and enter create asp.net core web project as below: Install the following NuGet package in our project: Microsoft.AspNetCore.SignalR Microsoft.AspNetCore.SpaServices.Extensions Call SignalR in the “Startup.ConfigureServices” method to add SignalR services: services.AddSignalR();   Create MessageHub Class: SignalR makes real-time client-to-server and server-to-client communications possible and it will call methods to connect clients from a server using Sign