Questions tagged as 'c#'

2
answers

How to select fields in a query in lambda expression?

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...
asked by 09.06.2016 / 02:47
2
answers

C # | Raise the Console Application window

How do I increase the Console Application window in C #? I use Visual Studio 2017 Community. My program will be done in Console Application, I need to change the size of the Console window being generated.     
asked by 07.06.2018 / 16:38
2
answers

Remove special characters and spaces from a string?

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...
asked by 15.11.2015 / 16:53
3
answers

Dynamic display of required, optional, or non-existent fields

There is a class that has 12 properties, which may be mandatory, optional or non-existent depending on the business rule specified in the registration of another class. How would I be able to compile a View that displays only the requi...
asked by 24.03.2014 / 14:22
3
answers

Entity Framework - Update nested lists

I have the following schema in my DB MySql: Modelshavealistofstandard_imagesandeachstandard_imageshasastandard_regionslist.IneedtouseEntityFramework5.0.0.Ihaveatemplatewith3standard_imagesandeachonehas4standard_regions.Ineedtodoanupdateonthis...
asked by 10.06.2014 / 14:08
2
answers

How does "new" and "virtual" work in C #?

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 {...
asked by 06.09.2016 / 00:13
2
answers

Access internal code structures C # / .NET

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...
asked by 16.06.2016 / 19:42
1
answer

How to get information from the computer with C #?

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.     
asked by 23.03.2015 / 13:07
3
answers

How to reuse event code?

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...
asked by 16.07.2016 / 22:04
2
answers

Cast problem in a generic method that receives an enum's array (enum [])

I want to make a generic method that gets a enum[] and returns a string representing the comma-separated array items. public static string ToSeparatedCommaString<T>(T[] enums) where T : struct, IComparable, IFormattable, I...
asked by 07.04.2015 / 18:27