Connection methods in ASP .NET [closed]

0

I am a beginner in ASP and C #. I have doubts and this is the real reason to ask here. Before you can read how the question policy is, understand that I am a beginner and really need help.

I have a question of how to connect to my ASP application with a database DB First .

As I'm starting, I've decided to raise as much information as possible. I initially read that there are two types of projects: Code First where classes are first developed and the database is automatically generated on top of that and Database First : database developed before the application.

After that I started to search how to make the connections, so I collected the following information:

  • Ado .net: Native to the .Net platform. All the examples I found were over Code First . All connections are automatically generated
  • Entity Framework: ORM heavily used in code first applications and it is not recommended to use in DB First applications 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 Code First applications.
  • Linq: Say this is a mask for SQL strings

Why is it so unwise to use all of these items in a DB First application?

    
asked by anonymous 21.02.2018 / 17:43

2 answers

0

The question is a little broad, but I think I can help you, because I went through this a few days ago.

It is important to decentralize the application database. How is this done? Through the Mapping performed on top of the existing database. I suggest you read this tutorial , go to clarify your doubts.

    
21.02.2018 / 19:37
0

Look, in fact, in the examples that gave ADO is the only way to connect to the bank. The others are ORM's or micro ORM's, etc.

Both will use ADO to connect to the bank.

ORM's convert the results from the bank into objects (basically). It is worth researching, because there is another meaning and reasons for the existence of ORM's.

You should not use all of them in the same application as you imagine the weight and the conflicts that would happen if you tried ... The Entity itself is already very heavy and very rigid (even plastered sometimes). It does not make much sense to mix with others, do you understand?

Regarding Db first or Code first. Code first : The bank is created according to the classes created in the application. The ORM is used for this.

Db First: The database already exists and we create the classes from that database, sometimes automatically.

Notes: You can already have a bank ready in code first, but you should be very careful when creating your classes.

    
21.02.2018 / 20:16