Hi,
I am using IBusinessService class. I use one helper method to create instance of this class.
creating instancce of this class is Expensive and takes time. I want to avoid create instance when IBusinessService already initaizalize.
class A
{
private readonly IBusinessService _service = API.BusinessService();
method1();
method2();
}
In above _service always created.
Using static suffices but observed break sometimes. application is api based so static is not recommanded I guess.

Mehul PrajapatiRank #6,843 · 255 reputationPosted Mar 1, 2018, 3:56 PM EST
Mehul PrajapatiRank #6,843 · 255 reputationPosted Mar 1, 2018, 3:59 PM EST
Sanjay SharmaRank #3,576 · 407 reputationPosted Mar 4, 2018, 6:42 PM EST