Answer the question
In order to leave comments, you need to log in
How to properly connect the database and the application?
Created a database, started writing an application for it. I am writing a connection between the application and the database. I ask to advise how it is possible to organize communication between application and a database.
Answer the question
In order to leave comments, you need to log in
What is an ORM
An example of a native ORM for your
healthy person ORM stack
Login and password access to the database is easy to tear out of the compiled exe. This key is not even "under the rug". If the DB is on the server, consider implementing the API.
EF or EF Core.
https://github.com/vkorotenko/FiasServer/blob/mast...
// direct request example
public void Truncate()
{
var truncate = "TRUNCATE TABLE HOUSE_HOUSENUM";
var reset = "DBCC CHECKIDENT ('HOUSE_HOUSENUM', RESEED, 0)";
_ctx.Database.ExecuteSqlRaw(truncate);
_ctx.Database.ExecuteSqlRaw(reset);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question