Questions tagged as '.net'

2
answers

I need to know when the user uses semicolons in decimal numbers

I'm developing an exercise whose result is different in scenarios that the user uses semicolon to place their decimal number, in case I put it as a variable of type double Console.WriteLine("Caculadora de Imc\n\n\n"); Console.WriteLine(...
asked by 05.11.2017 / 00:17
2
answers

What are anonymous methods and what is their main purpose?

I know they're used to working with delegates , but the sources I found were a bit confusing in my opinion.     
asked by 04.10.2017 / 03:17
1
answer

What is the best validation strategy before the data persist? [closed]

I'm used to .NET using C # and EntityFramework. And there in Entity we have dataanotations . When I create the entity in C #, for example of person, just put the datanotaations and the Entity is valid for me: public partial cla...
asked by 23.10.2017 / 20:08
3
answers

How to search for a file in all folders

How to create an application that performs a full search on a folder or disk looking for a file that neither in the image I've already tried to use Directory.GetFiles and Directory.GetDirectory But when it arrives at a folder...
asked by 16.07.2015 / 21:56
1
answer

Pagination with generic method

I'm trying to create a generic paging method, I tried to do as the code below, however when using Skip I need to have a orderby and I'm not sure how to do it. public IQueryable<TEntity> GetPaginacao(int PageStart, int PageS...
asked by 14.01.2016 / 15:29
1
answer

Vector start with element greater than 0 (zero)?

Usually a vetor starts from element 0 , and so on until it reaches the size of which it was declared or assigned, eg: string[] v = {1, 2 , 3}; // equivalente á: v[0] = 1; v[1] = 2; v[2] = 3; I want to know how to do in C#...
asked by 13.01.2016 / 19:21
1
answer

Controller routing and actions in lowercase

How to make the controllers and actions routes all in lowercase? For example: instead of Noticias/Details get noticias/details .     
asked by 31.07.2015 / 14:38
1
answer

How to change a property during a LINQ query?

Is there any way to change a LINQ query property of the query itself? Ex: I'm doing a query on List<Cliente> and I want all clients whose NomeFantasia starts with * to have the symbol removed from the name. Her...
asked by 14.08.2015 / 14:48
3
answers

Relationship Has-in C #?

I tried to make a relationship in C # and I'm not getting it and I do not even know if it's recommended to do it. Here is my error code:    System.NullReferenceException Object reference not set to an instance of an object. class Progra...
asked by 06.02.2015 / 00:15
2
answers

How to capture assembly from classes that inherit from a single class

I have numerous classes. All inherit from a single class public abstract class ClasseBase { public int Id {get;set;} } and other classes: public class Teste1 : ClasseBase{ } public class Teste2 : ClasseBase { } You would need to...
asked by 04.12.2014 / 18:56