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...
In .NET, under what circumstances should GC.SuppressFinalize() be used?
What are the advantages of using this method?
Note: I found the answer in the SO-en: When should I use GC.SuppressFinalize ()? As I did not have something r...
1) When I create an object, where it has arrays and large variables, setting them to null , will it help with the reduction? Within a method Dispose() - being that before they were with some value.
2) When I call a Dispose()...
Why is this line required in Java?
fout.close();
Context:
LinkedList values = new LinkedList(classe.getTurma().values());
if (!values.isEmpty()) {
FileOutputStream fout = null;
String FILE = "TURMA";
try {...
dispose() frees the object from memory, right? I do not know when it is necessary to use it. For example, I have a page, on this page there is listBox com
visible = "false" , in an event this listBox becomes true...
I have the following hypothetical code.
using (var QDR = new DAL.teste())
{
//codigos
using (var QDR1 = new DAL.teste1())
{
//codigos
using (var QDR2 = new DAL.teste2())
{
// códigos
}
}
}
Is...
In Web Forms whenever I mounted some kind of CRUD , I used using to make an implen in>.
public List<Produtos> Lista ()
{
using (var ctx = new DbContext())
{
return ctx. Produtos.ToList();
}
}
In ASP.NET MVC th...
Some questions about the interface IDisposable and using already exist, for example:
What types of features are released in a using statement
I should always use the dispose
I'm still not sure what to do about threads...
I need to leave the file free, without being in use because it is barring. Here is the code:
StringWriter sw = new StringWriter();
XmlTextWriter tw = new XmlTextWriter(sw);
XmlSerializerNamespaces xsn = new XmlSerializerNamespaces();
xsn.Add(...
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 :
priv...