ASP .NET Core MVC, partitioned controllers and views into several csprojs

To partition your core project into several csprojs is easy or maybe you want to make use of one or more common functionality between multiple apps. ASP.Net Core came with an abstraction over the resource of an app, it’s called application parts. Using an appliction part, we can share controllers,views, tag helpers etc intoContinue reading “ASP .NET Core MVC, partitioned controllers and views into several csprojs”

Cosuming JSON Rest API in C#

There is a lof of good libraries to consume JSON API in C#, we can search for rest client in First item on the search result is RestSharp,  a simple REST and Http API client. You can also use System.Net.Http.HttpClient as it is a base for sending http requests and receiving http responses providedContinue reading “Cosuming JSON Rest API in C#”

c#: Sorting List of Complex Type or an Object using IComparable

To do sorting with List<T> of your own object type you need to implement IComparable<T> interface into the class itself. So when you have a List of the object you can easily call listOfObject.Sort() to sort the content of that list. For example: imagine you have a Class Schedule for work schedule and that classContinue reading “c#: Sorting List of Complex Type or an Object using IComparable” core MVC login menggunakan custom database. Part-2

HttpPost, HttpGet dan Authorize attributes. Melanjutkan artikel part-1. Untuk meng-handle autentikasi dan input dari login form yang dikirim browser dengan metod POST, harus menggunakan HttpPost attribute pada method/action yang ada di SecurityController. Untuk itu tambahkan method baru yaitu Login dengan parameter type LoginViewModel. Saya akan menjelaskan gambar diatas, attribute yang dipakai adalah [HttpPost], [AllowAnonymous] danContinue reading “ core MVC login menggunakan custom database. Part-2”

Belajar .NET Core MVC di Linux.

Install .net core sdk dan cli. belajar .NET Core MVC, pertama lakukan instalasi .NET Core SDK dengan tutorial ini. tergantung operating system yang dipakai, .net core adalah open source .net yang bisa berjalan di windows,linux dan mac os. Karena cross platform maka .net core menjadi salah satu platform yang terkenal beberapa tahun terakhir ini, meskipunContinue reading “Belajar .NET Core MVC di Linux.”