Author: Marinko Spasojevic

Entity Framework Core Relationships – Convention, Data Annotations and Fluent API

In the second part of this series, we have learned how to configure non-relational properties in Entity Framework Core. So as a logical continuation, this article will be dedicated to learning about database relationships configuration with Entity Framework Core (EF Core Relationships). We will show you how to create additional entities in the database model and how to create relationships between them. We are going to use all three ways: by Convention, Data Annotations and Fluent API, to create those relationships. You can download the source code for this article on our GitHub repository. To see all the basic...

Read More

Migrations and Seed Data with Entity Framework Core

In this section, we are going to cover Migrations and Seed data features in Entity Framework Core. In the previous parts of this series, we have created the database model (entity and context classes) and applied different configuration options. Now it is time to transfer this database model to the real database in SQL server. Our SQL database schema needs to be aligned with our application’s database model and using migrations will help us keep things that way. EF Core provides a method called Migrate to execute migration actions for us. All we have to do is to create...

Read More

Configuring Nonrelational Properties in EF Core

In the previous article, we have created a basic setup for Entity Framework Core in our ASP.NET Core project. In this article, we are going to talk about the EF Core configuration and the different configuration approaches. You can download the source code for this article on our GitHub repository. To see all the basic instructions and complete navigation for this series, visit Entity Framework Core with ASP.NET Core Tutorial. There are three approaches to configuring Entity Framework Core: By Convention Data Annotations Fluent API We are going to work with migrations in the next part of this series,...

Read More

Getting Started with Entity Framework Core in ASP.NET Core – Models, DbContext, Configuration

In this article, we are going to get started with EF Core in ASP.NET Core. We are going to show you how to create model classes and how to create and prepare a context class. Additionally, we are going to talk about the DbContext class in detail and show you how it helps with the database modeling process. Overall we are going to go through a variety of basic but crucial information which will be valuable to you when starting with an ASP.NET Core project that uses EF Core as ORM (object relational mapper). You can download the source...

Read More

Consuming a GraphQL API with Angular

In the previous article, we have created an ASP.NET Core application to consume a GraphQL API. But we don’t have to use only ASP.NET Core app to consume a GraphQL API, we can do the same thing with the Angular application. To accomplish that, we are going to use the Apollo library which will help us in the process. We won’t dive deep into the Angular project development, for that, we have a great Angular Tutorial on that subject as well. Getting Started with GraphQL in ASP.NET Core Advanced GraphQL Queries, Error Handling, Data Loader GraphQL Mutations (POST, PUT,...

Read More