0
I’m a beginner in ASP and C#. I have doubts and this is the real reason to ask here. Before you have to read the politics of questions understand that I am a beginner and I really need help.
I have a question how to connect my ASP application to a database DB First
.
As I’m starting out, I decided to gather as much information as possible. I initially read that there are two types of projects: the Code First
where classes are first developed and the database is automatically generated on top of that and the Database First
: database developed before application.
After that I started researching how to make the connections, then I collected the following information:
- Ado . net: Native to the .Net. platform All the examples I found were on top of the
Code First
. All connections are automatically generated - Entity Framework:
ORM
heavily used in applicationscode first
and is not advised to use in applicationsDB First
because the code would be too long and difficult to understand. - Dapper: Micro ORM, developed by someone from
stack overflow
, fast and efficient. Also recommended for applicationsCode First
. - Linq: In passing say that it is a mask for SQL strings
Why it is so advised to use all these items in one application DB First
?
DB First is something that the creators of Orms like EF have left aside and moved on to applications that use Code First as a focus so you should have seen it in many places if you say it is advisable. What is advisable is not always what we need in our applications... Your question is very confusing... I don’t know if you want to make a connection to the bank or know the difference between code first and db first.
– Marco Souza
So I have to reinvent the wheel every time? What happens when I already have a database? Do I have to recreate it? Unviable...
– Moisolas
No... You can simply create your code first by mapping your existing database ...
– Marco Souza
see documentation https://msdn.microsoft.com/en-us/library/jj200620(v=vs.113). aspx
– Marco Souza
But on some sites I read reported that this mapping makes the code extensive and difficult to understand.
– Moisolas