SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Connect Using the Microsoft Entity Framework Core (EF Core)

Create and debug an EF Core application that connects to SAP HANA.

Overview

🎓 beginner 15 min. SAP HANA CloudBeginnerSAP HANA Cloud SAP HANA DatabaseSAP HANASAP HANA Express Edition

You will learn

  • โœ”How to install the .NET Core EF CLI
  • โœ”How to create and debug an EF Core application that queries an SAP HANA database
  • โœ”How to use the scaffold command to generate entity classes for pre-existing schema tables
Unknown U Unknown May 1, 2026
Created by February 22, 2023
Contributors

Prerequisites

Prerequisites

  • You have completed the first 3 tutorials in this mission
  • You have completed the previous tutorial on .NET in this mission

Steps

Intro

.NET is a free and open-source software framework for Microsoft Windows, Linux, and Mac operating systems and is the successor to the .NET Framework. Entity Framework Core is a modern object-database mapper for .NET and can reduce data access code in an application.


Step 1 Install the .NET Core EF CLI
โ€”

The dotnet tool command can be used to install and manage tools that extend .NET. The following are a few examples that can be run to show help, to list the local and globally installed tools, to uninstall dotnet-ef if an incompatible version is installed, and to search the repository for version details of the dotnet-ef tool.

Shell
dotnet tool -h
dotnet tool list -h
dotnet tool list
dotnet tool list -g
dotnet tool uninstall dotnet-ef -g
dotnet tool search dotnet-ef --detail

The SAP HANA Client 2.28 release supports EF Core 9.0 among other versions. For a list versions and support dates see EF Core releases and planning and SAP Note 3165810 - SAP HANA Client Supported Platforms.

Run the following command to install version 9 of the dotnet-ef tool.

Shell
dotnet tool install dotnet-ef --version 9.0.14 -g
dotnet tool list -g

.NET Core EF CLI Install
.NET Core EF CLI Install

The help for the .NET Command Line Tools can be displayed as shown below.

Shell
dotnet ef -h

entity framework tools
entity framework tools

Step 2 Create a .NET Core EF application that queries an SAP HANA database
+
Step 3 Debug the application
+
Step 4 Generate scaffolding classes for an existing schema
+
Step 5 Knowledge check
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 5
1. Install the .NET Core EF CLI 2. Create a .NET Core EF application that queries an SAP HANA database 3. Debug the application 4. Generate scaffolding classes for an existing schema 5. Knowledge check

Learn more →