10
I use the IOC standard in my project which facilitates the call of procedure type Resolver.Resolve<IPedido>().GerarPedido(), however, I did not want to leave "loose" in this way, I would like to implement the method IDisposable wear like this:
using (var pedido = Resolver.Resolve<IPedido>())
{
pedido.GerarPedido();
}
- I can implement
IDisposablein a simple class, in this example,Pedido? It would be good practice? - Has processing cost?
- How best to implement
IDisposablein this example?
For a class to have to implement Idisposable there has to be a reason, in your case what is?
– ramaral
Well, in my mind, I wanted to
matarResolver.Resolve<IPedido>().GerarPedido()soon after its execution. The classPedidois a basic class, does not use any external component.– rubStackOverflow
@rubStackOverflow What "kill" the request means?
– dcastro
Remove from memory :) @dcastro
– rubStackOverflow