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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amit MohantyPosted Dec 5, 2022, 5:20 AM
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/