Posts

Showing posts from 2018

Work with HTML5 Video Player with Angular 2+

Image
Hi coders, This is just a straight forward post. I'll explain you all, how to use the html5 video player ( https://www.w3schools.com/html/html5_video.asp ) with angular. Actually there are some tricky parts as well, such as; not refreshing the video when clicking on multiple video urls. So, lets get started. video-player.component.html <div id=" jobCallDetailModal " class="modal fade dashboardN" role="dialog" data-backdrop="static"> <div class="modal-dialog modal-lg modal-xl"> <div class="modal-content"> <div class="modal-header" *ngIf="callDetails != null" > <button type="button" class="close" (click)="closeVideoViewer()"> <i class="ti ti-close"></i> </button> <h5 class="modal-title float-left">Job

Firebase with.Net Core and C#

Image
Hi folks, Are you developing web applications with .net ? Are you supporting mobile applications to communicate with your applications ? Are you thinking of providing realtime capabilities with your apps? Then I suggest you to read on Firebase Real-Time Dataabses by Google. " The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and synchronized in realtime to every connected client. " - Google Firebase Team Read more:  https://firebase.google.com/docs/database/ In this post I'm going to discuss what is firebase but I'm going to discuss how to work with it with .Net C#. Firebase doesn't provide a separate library or a nugget to work with .Net, so you might find this bit tricky when you have to work with it from the backend. Senario To demonstrate the solution I will create a scenario. In my scenario we have created a video call function (which is implemented with OpenTok library) and it allows users to create sessions and i

Authenticate users with JWT (JSON Web Tokens) with .Net and TypeScript

Image
When creating web applications, it is a common thing to provide a user login function. And when creating user logins it is required to authenticate them probably using a token which contain the user session data and user role data. When considering the token creation and authenticate it there are several ways and technologies to do and in this blog I would like to explain how to create token and validate it using JWT (JSON Web Tokens). Read about JWT from here There are several packages in NuGet store that provide JWT features and in this article I'm going to use  System.IdentityModel.Tokens.Jwt  Install this in your project using the NuGet package manager. Ok, now let's get started. 1.      Create token Let's create a class to create token when user log in to the system.  Create a hased key of SHA256 to use when crating the token.  using System; using System.Text; using System.IdentityModel.Tokens.Jwt; using Microsoft.IdentityModel.Tokens; priv

Using Entity Framework Core with MySQL for .Net Core 2 Web API

Image
.Net Core 2.0 released and you might using it for learning or actual production purposes. With .Net Core you usually use Entity Framework Core to communicate with your database, and usually you might use MS SQL Server with this environment. But have you thought about MySql Database? Couldn't find any good resource to how to do this? Then you are in the correct place. In this post I'll explain you how to use MySql as you Database while using .Net Core backend. Let's get started. I'm developing this in a Mac and I'm using Visual Studio Community for Mac. For this example I'll create a Web API project and get pre entered data from MySql database. 1. Open MySql management tool and do following.  1.1. Create a database (UserDB) 1.2. Create a table (Users) 1.3. Add fields to Users table (Username, Password, etc.) 1.4. Add some sample data to the table. 2. Create a .Net Core Web API project using Visual Studio.  I have created as UserLog

Host an ASP.Net Core project in Bitbucket (Using Visual Studio for Mac)

Image
When you are stared to do your own project the main concern and the importance will be the security of your source code. How do you make sure it is safe? What happen if you lose your hard drive or your laptop which have all your project source code? All of your effort will lose, isn't it? But nowadays you can safeguard your code using a source control service. Bitbucket is a great place to start. It has a free plan for small teams, so you can use this. In this post I'll explain how to host your .Net Core project using Bitbucket from mac. Let's get started. Prerequisites Before we get stared you have to install following in your mac. 1. Git - Download it from  https://git-scm.com/downloads  and install it. 2. Visual Studio for Mac - Download it from  https://www.visualstudio.com/vs/mac/  and install it. Ok. I assume that you have all the prerequisite software installed in your mac. Now follow the bellow steps. 1. Create an account in Bitbucket ( https://bitb