Posts

Showing posts from December, 2017

Publish Angular application with Angular CLI and AspDotNet Core

Publish Angular application with Angular CLI and AspDotNet Core A few months back I showed how to bootstrap an Angular application using Angular CLI . Apart from bootstrapping and serving, Angular CLI is also capable of packing the application and get it ready to be published in order for us to serve it on our own webserver. Today we will see how the process of publishing can be done in three steps 1. Prepare the project for packing 2. Create a host 3. Publish the application 1. Prepare the project for packing In order to ease the understanding, we start by separating our client Angular application and Host application. The client will go into /client while the host into /host . Here a preview of how the structure will look like: - MyApplication | - /.git | - /client | - /e2e | - /node_modules | - /src | - ... | - /host (nothing here yet) | - /Host | - MyApplication.Host.sln In order to create t...

Save array of string EntityFramework Core

Save array of string EntityFramework Core EntityFramework is a ORM where R stands for Relational (database). Relational databases operate with tables, rows and columns. If we have an object containing an array of objects, by default, it would translate to two tables and a JOIN between the two tables. This behaviour is great if our initial model has links to other objects but not so great when the array inside of model is only composed by primitive type values, like strings. Today we will see how we can store array of values as property of our model and prevent having to create two tables with a JOIN. 1. Install EntityFramework Core Sqlite 2. Save array of primitive type values All the code can be found on my GitHub . 1. Install EntityFramework Core Sqlite In this example I will be using Sqlite. We start by creating two projects, a .NET Core/ASP.NET Core project and a .NET Standard library project. In the library we install Microsoft.EntityFrameworkCore and in the web project we...

Microsoft Orleans logs warnings and errors

Microsoft Orleans logs warnings and errors Microsoft Orleans is a framework which helps building distributed system by implementing the actor model together with the concept of virtual actors, taking care of availability and concurrency. If you are unfamiliar with Microsoft Orleans, you can look at my previous blog post explaining the benefits of Microsoft Orleans . Even though Orleans promises to abstract the distributed system problems, there are instances where errors arise without us being able to understand what is going on. Lucky us, the logs are well documented… but only for those who can decrypt them. Today I will go through some of the errors and warnings which can be seen from silo and client so that you too can undestand what is going on. Enjoy! The code used to produce those errors can be found on my GitHub https://github.com/Kimserey/orleans-cluster-consul . 1. Client logs Logs on client appears with address {ip}:0 . 1.1. Can’t find implementation of interface An un...

How to setup Continuous Integration/Deployment with GitLab for ASP NET Core application

Image
How to setup Continuous Integration/Deployment with GitLab for ASP NET Core application In any application, Continuous Integration and Continous Deployment environments are important to setup to remove respectively the risking of breaking your application while pushing code to master branch and having to manually deploy your application each time you need to either test it or deliver it. GitLab comes with a set of features to integrate quickly CI/CD to your application for free! Today we will see how we can setup CI/CD by leveraging the free services from GitLab. This post will be composed by 4 parts: 1. Overview of the scenario 2. Setup a runner 3. Configure your job 4. Monitor your deployment on GitLab 1. Overview of the scenario The example that I will take is an ASP NET Core application which runs as a Windows service. My scenario is the most simplistic one may have: I want to setup CI, meaning build and running test and detect break in my code at each push to master branc...

Prime NG data table for Angular

Image
Prime NG data table for Angular In every web application there is a need to display data in a tabular form. If the amount of data is small, a simple combination of HTML with Bootstrap is enough. But when the data is large, or more advanced functionalities are needed like sort or pagination, a more elaborated table needs to be used. If you followed me, you must have noticed that I am a huge fan of Prime NG and once again, Prime NG saves us the burden of implementing a complex data table by providing an Angular component fully featured. Today we will see how to use it in 3 parts: 1. Use Prime NG data table 2. Customized cell template 3. Pagination All the source code for this example is available on my GitHub . 1. Use Prime NG data table 1.1 Basic usage Start by installing Prime NG. npm install primeng --save Then in your main app module, register the DataTableModule to get access to its components. @NgModule({ imports: [ ... other imports DataTableModule ], ... o...