Author: Code Maze

Using C# and DalSoft.RestClient to Consume Any REST API

This post is going to take you through using the DalSoft.RestClient C# library to consume a RESTful API. We are going to show you the most common scenarios using live examples from the REST API JSONPlaceholder. We are using JSONPlaceholder because it’s a great tool for testing REST clients without requiring registration or standing up your own REST API. In this post you’ll learn: What is DalSoft.RestClient? Setting up DalSoft.RestClient What does DalSoft.RestClient Offer? Understanding the DalSoft.RestClient convention HttpResponseMessage and body ToString() Query Strings Headers How to Write Get, Post, Put/Patch, and Delete Requests Casting and Serialization Casting Collections Serialization...

Read More

ASP.NET Core Web API with EF Core DB-First Approach

In this article, we’ll take a look at the EF Core Database-First approach. In this approach, we create our database first. We then model our entities. This approach is useful when we work with an existing database. This is also useful when we migrate from existing applications. A relational database deals with related data. So, we’ll also take a look at different types of relationships in the database and how we can represent those while modeling our entities. There are 3 types of relationships in relational database design: One-to-One – A row in Table A can have only one matching row in Table B,...

Read More

ASP.NET Core Web API with EF Core Code-First Approach

While working with the EF Core Code-First approach, we create the classes for our domain entities first. Later, we’ll create the database from our code by using migrations. This is the opposite of the Database-First approach where we design our database first and then create the classes which match our database design. In the EF Core Code-First approach, we have full control over the code and the database is just a store without any logic. This approach is helpful in situations where we are starting with the development of a new project and we don’t have a clear picture...

Read More

Enabling CORS in ASP.NET Core

In this post, we are going to talk about enabling CORS in ASP.NET Core Web Applications. You can find the source code for this blog post on GitHub. This post is divided into the following sections: About Same-Origin and What it Means What Is the Same-Origin policy? What Is CORS? How Does CORS Work? Inner Workings Preflight Requests Demo Same-Origin Policy in Action Enabling CORS Configuring CORS Requests Configure CORS Policy Options Before we understand how to enable CORS in ASP.NET Core applications, we need to understand an important concept in the web application security model called the Same-Origin...

Read More

Creating Vue.js Client Side – Two-way binding and v-model directive (Create and Update Components)

We are still missing the create and update components and in this article, we are going to implement these missing parts. With this post, we are going to finalize our application development process. For the complete series navigation visit: Vue.js Series. To download the source code for this part, visit Create and Update Owner Entity Source Code. This post is divided into several sections: Creating Owner Entity Editing Owner Entity Conclusion Creating Owner Entity We are going to create a form which has three input fields: name, date of birth and address. As soon as the user fills up...

Read More