Questions tagged as 'c#'

1
answer

What are closures and what is their use?

The answer to this lambda question What are lambda expressions? And what's the point in using them? talks about closures and expressions tree, however, does not have a clear example of what they are in fact and what their main use. So what are...
asked by 03.09.2014 / 22:11
3
answers

How to customize error pages in an ASP.NET MVC system?

How to display a friendlier page when an error occurs in my asp.net mvc application (and not that yellow page)?     
asked by 13.12.2013 / 17:29
2
answers

How to get a snippet of a string?

I have a string like this: ~/Areas/Teste/Views/home/index.cshtml I only need the word next to ~/Areas/ , in the case Teste (remembering that word may vary in size). How do I?     
asked by 09.10.2014 / 15:56
2
answers

Check if a word is within a phrase

Is there a way to check if a word is within a user-described phrase? Ex: palavra = "criativo"; Sentence written by the user: "Eu sou criativo"     
asked by 16.10.2015 / 15:43
3
answers

Reading XML NFe?

I'm doing an XML reading from Nfe however, I'm currently reading and playing in a txt , but I can not read those tags below: <?xml version="1.0" encoding="UTF-8"?> <nfeProc xmlns="http://www.portalfiscal.inf.br/nfe" versao="2....
asked by 16.12.2014 / 17:05
3
answers

Remove Saturdays and Sundays from Calculation

I have a project where I work with project activities, my activities have a certain time to complete, but the project has to do the calculation only with administrative days. For example, an activity starts on 10/26/2015 (Monday) and its dura...
asked by 25.10.2015 / 19:22
3
answers

Master-detail in MVC C # with Razor

Personal I need to set up a master-detail master record. I've already researched and seen a few examples on the internet, however as I do for when the master is not registered, the details are stored temporarily for the general save save the mas...
asked by 10.03.2014 / 18:17
2
answers

What's the difference between using a comparison with = or simply?

Imagine the following scenario. int i = 2; if(i >= 2) { //.... } When we could simply summarize for; int i = 2; if(i > 1) { //.... } My doubts with these two expressions are as follows: When a low-level language interp...
asked by 01.11.2016 / 15:47
2
answers

String interpolation has a better performance than string.Format?

I use Resharper and a few days ago I started using some C # 6 features. In several parts of the code I use string.Format() and I noticed that the Resharper suggests that these snippets be replaced by string interpolation . The ques...
asked by 19.10.2015 / 14:27
2
answers

What is the purpose of empty command blocks or which do not belong to any command?

A command block is made up of two or more commands in {...//Comandos} keys, I can use them for the following situations I already know: In an if: if(codicao){...//Comandos} . In a for: for(inicializacao; condicao; incremento)...
asked by 22.01.2016 / 02:37