Questions tagged as 'c#'

4
answers

How to do a search to know if a string is inside a vector in C #

I'm doing a small program that does search within a vector. The problem I am having is that if it finds the name it gives a message saying it was found but then it gives another message saying that it was not found, the code I am creating is thi...
asked by 30.05.2017 / 10:09
1
answer

What is the purpose of an empty parenthesis in a Lambda declaration?

I created an example of a Lambda declaration with no arguments, however, I am in doubt about omission of the empty parenthesis () in the declaration. See the example: class Program { public delegate void MyDelegate(); static...
asked by 23.06.2016 / 00:34
1
answer

Get index backwards

Imagine I have the following string: string texto = "Stackoverflow em Português"; If I want to know the index of the first space, just: int index = texto.IndexOf(" "); But in this case I have two spaces, and I would like to get the ind...
asked by 18.11.2015 / 11:30
2
answers

Is it a good practice to use summary for documentation?

Is this the best way to document code in C #? /// <summary> /// Descrição /// </summary>     
asked by 19.03.2014 / 20:19
4
answers

How do I assign a value to an enum with binary notation?

To work with hexadecimal numbers, just add 0x in front of the number, like this: var numeroHexa = 0xff1120; The same goes for octal numbers, adding 0 : var numeroOct = 037; But how do you declare binary numbers? var nume...
asked by 23.04.2014 / 15:53
3
answers

Session limitation for saving data

I have a slow query in Oracle to list all accesses for a user, so I thought of writing the result to a Session , the average of records returned is 600, with%? Would you have any other better way to save this data?     
asked by 30.09.2015 / 21:29
2
answers

Serialize object list for JSON: A circular reference was detected while serializing an object of type

I'm trying to Serialize a list of objects to Json and I have received the following error: An exception of type    'System.InvalidOperationException' occurred in   Microsoft.Web.Extensions.dll but was not handled in user code   Additio...
asked by 07.10.2014 / 15:36
1
answer

Doubt about mapping in the Entity Framework 6. Properties "readonly"

I have three tables in my bank: TB_COLABORATOR TB_JORNADA TB_JORNADA_COLABORADOR TB_JORNADA_COLABORADOR associates employees with the day and vice versa through the COD_JORNADA and COD_COLABORADOR fields. It also...
asked by 15.06.2015 / 15:33
3
answers

Design Pattern for Filters

First, filter in my current context is a list of objects to be used in ComboBox type controls so that the user can choose from the options. My scenery: Screen 1 - It has filters of companies, stocks, customers, forms of payment. Screen 2 - It...
asked by 04.08.2015 / 18:52
5
answers

Property readonly .NET

I received this question in a test and could not answer: "How can I declare a readonly property in .NET / C #?"     
asked by 31.01.2014 / 15:36