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...
Is there any way to automatically execute a method by destroying an instance of a class. I have a generic SQL class, where in the constructor I call a method that opens the connection. Only I want to close this connection automatically too, with...
I am creating a simple Form that has 3 TextBoxes and 3 buttons and I want to save the information entered in Textboxes in a table.
I have already created querys all within a class acessoBD , but I can not acc...
Using Entity Framework Code First, with view model and model .
To create a column with varchar(2) , I need to put MaxLength(2) in model and view model ?
I made a query in the database in 2 tables and saved in 2 objects in the controller , but I can only send 1 object to view .
// Controller
// Pego os dados do BD e salvo no objeto
var objPessoa = new PessoaAplic();
var dadosPessoa = objPesso...
Lately I've been using Resharper and I've enjoyed the experience of using it, but something has intrigued me. At times it suggests that certain variables be declared within some scopes, as in the example below:
var a = 0;
for(var i = 0; i&...
When we use a foreach loop, does the local variable we create to receive the content of the list in question pass by value or reference?
Ex:
foreach (var item in listItems)
{
//TODO
}
Does item receive content by value o...
I program in PHP and am starting to learn how to program in C # ASP.Net MVC, however I have some questions:
What is the @ (arroba) serving in both the controller and the view ?
What is the purpose of these { get; set; } calls th...
I have an enum (enumeration) calling Notas and I need to get the integer corresponding to one of its constants.
public enum Nota
{
Otimo = 5,
MuitoBom = 4,
Bom = 3,
Regular = 2,
Ruim = 1,
Insuficiente = 0
}
I...