A question about casting in C #, I see in many sources using cast in the following ways.
What's the difference between one and the other when using one way or another?
public interface InterfaceTeste
{
int Id { get; set; }
}
public...
I am using Resharper to automate overwriting of the Equals method and the == operator. One of the methods the tool overwritten is GetHashCode :
public override int GetHashCode()
{
unchecked
{
return (Id.GetH...
I'm developing an ASP.NET MVC 4 application and need to save the log of every change made to a Model object.
Is there any native method or implementation already known that does this? Example:
public class Pessoa
{
public int? Id { ge...
You have a parent class and a daughter, and would like to execute a particular method, such as an event, always at the end of each method call for the child classes.
How can I do it?
Through% of LINQ% I can select which fields will be displayed in the query, for example:
var subCategorias = from s in db.SubCategoria
join c in db.CategoriaProduto
on s.id_categoria equals c.id_cat...
I have a problem, in an app I'm picking up contacts from the phonebook, however I want to make a treatment in the contact numbers that can come like this:
(99) 9999-9999
9999-9999
9999 9999
and among other things, the only treatment I did w...
Can you explain to me how they work in C #?
When I create a parent class and it has a teste() method and I want to rewrite this method in the child class, I need to use virtual and new ?
If I create:
class Veiculo {...
Is it possible to access the inner structures of a C # core code or .NET System.Core libraries? For example, how is the First() method implemented?
Alerta alerta = query.First();
I wanted to see how this is done behind the sce...
As the information on the computer where the C # application is running, such as computer name, IP, firewall status, whether antivirus is installed, whether antivirus is enabled, etc.
I have events that when pressing different keys perform some actions but I need to use this thing in more than one form , how can I do this?
I found the issue of inheritance in C # Windows Forms a little complicated.
An example that I use...