I use the IOC standard in my project which facilitates the procedure call of type Resolver.Resolve<IPedido>().GerarPedido()
, but I did not want to leave it "loose" in this way, I would like to implement the method IDisposable
use like this:
using (var pedido = Resolver.Resolve<IPedido>())
{
pedido.GerarPedido();
}
IDisposable
in a simple class, in this example, Pedido
? Would it be a good practice? IDisposable
in this example?