DB Connection Entity Frame in ASP.net Core MVC or ODP.net

Asked 2 years ago, Updated 2 years ago, 119 views

We are creating a web API using the ASP.net Core MVC model.
So I would like to connect to the database and issue SQL and execute procedures.
Until now, I have used ODP.net to attach a connection to the Oracle database and write SQL.
However, when I investigate information related to ASP.net Core MVC, many of them use Entity Framework.
I touched it for a while, but the preparation was quite troublesome.
It's not hard to understand that it's highly serviceable, but it's a mystery that it's efficient to develop.
Personally, I prefer ODP.net, where I can put a quick connection and write SQL freely.

Which one is better?

c# .net oracle asp.net-core entity-framework

2022-09-30 19:47

2 Answers

ODP.NET+Dapper is no choice.

"Data Point - Dapper, Entity Framework and Hybrid Apps"
https://docs.microsoft.com/ja-jp/archive/msdn-magazine/2016/may/data-points-dapper-entity-framework-and-hybrid-apps

Stack Overflow made it.

I tried using it myself and it was very easy to use.
Wouldn't it be good for people who have written SQL?


2022-09-30 19:47

Which one is better?
It's not hard to understand that it's highly serviceable, but it's a mystery that it's efficient to develop.

Apart from the questioner's experience, knowledge, skills and other special circumstances, choose the Entity Framework for both development efficiency and serviceability.

If you think about information such as DB generation using EF Code First, reverse engineering automatically generates context and entity classes, automatic generation of Controller/View code for CRUD using the Scaffolding feature, and net books including Microsoft tutorials (e.g. below).

Part 4, Add model to ASP.NET Core MVC app
https://docs.microsoft.com/ja-jp/aspnet/core/tutorials/first-mvc-app/adding-model?view=aspnetcore-6.0&tabs=visual-studio

ASP.NET Core MVC and EF Core - Tutorial Series
https://docs.microsoft.com/ja-jp/aspnet/core/data/ef-mvc/?view=aspnetcore-5.0


2022-09-30 19:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.