I have a web application and I'm using repository * and Unit Of Work .
In some examples I saw that after performing some change operation on the bank we should call the Dispose()
method.
Instantiated UnitOfWork
:
private UnitOfWork unitOfWork = new UnitOfWork();
When you make a update change and call Dispose()
, you can not bind in grid passed Dispose()
.
Alternatively, I'm using using
:
using (UnitOfWork unitOfWork = new UnitOfWork())
{
//Código.
}
My question is: using pattern Unit Of Work is it correct to use using
? If not, where should I call Dispose()
?