using(novemberEntities entities=new novemberEntities())
{
return entities.jayatables.ToList();
}
we can create
novemberEntities entities=new novemberEntities());
but what is the use of using " Using{ } ";
using(novemberEntities entities=new novemberEntities())
{
return entities.jayatables.ToList();
}
we can create
novemberEntities entities=new novemberEntities());
but what is the use of using " Using{ } ";
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit MohantyRank #112 · 20K reputationPosted Dec 5, 2022, 12:20 AM EST
The using statement is used to set one or more than one resource. These resources are executed and the resource is released. The main goal is to manage resources and release all the resources automatically.
In other words, the using statement tells .NET to release the object specified in the using block once it is no longer needed.
For more details check below link.
https://www.c-sharpcorner.com/article/the-using-statement-in-C-Sharp/