Questions tagged as 'c#'

2
answers

How to implement the Standard Repository in C # with EF?

I want to make an implementation of the Repository pattern where I'll be using EntityFramework and have the following: p> Interface IRepository : public interface IRepository<T> where T : class { T GetById(int id);...
asked by 16.05.2014 / 21:37
2
answers

Optimize foreach

I need to check if listaContrato items exist in listaPendencia , if there is no enable to false to be disabled on the screen. What can I do to improve the performance of foreach below? Both lists are List<>...
asked by 10.11.2016 / 15:18
3
answers

How to encrypt and decrypt data in MD5 using C #?

How to make MD5 encryptions with C # of a text or file? And once already encrypted, how to decrypt?     
asked by 26.05.2014 / 21:27
2
answers

#region is an antipattern or a code smell?

The #region of Visual Studio it hides the codes, everyone says that it is bad because it exists? Is it an antipattern or a code smell ?     
asked by 25.08.2015 / 14:01
2
answers

Is it possible to program using the WinRT API without using XAML?

For some time now, declarative languages have taken over the development of software for creating graphical user interfaces. The most obvious examples are the framework WPF that uses XAML (eXtensible Application Markup Language) as a declara...
asked by 23.12.2013 / 13:12
1
answer

What is the method group?

Coding in C # I ended up making a mistake, maybe because of familiarity with other languages I usually work with, and I forgot the parentheses. string.Concat(numero.ToString, "A") I received the following error:    can not convert from '...
asked by 14.03.2017 / 13:13
1
answer

At what point does the Entity Framework query an IQueryable?

I'm developing a method for an API that consists of the following: fetch all evaluations from a given client and, if specified, limit the amount of records that will be returned. For example: public IEnumerable<Avaliacao> GetAvaliacoe...
asked by 16.02.2016 / 21:50
1
answer

Methods ExecuteReader (), ExecuteNonQuery () and ExecuteScalar (), what are the differences and how to use them?

I'm working with SQL Server database in C #, but I noticed that the SqlCommand object has several methods to execute a query , they are: ExecuteReader() , ExecuteNonQuery() and ExecuteScalar() . My question is, what...
asked by 24.10.2015 / 00:26
1
answer

Asp.net MVC adding application name in URL

I have a domain on a shared server and inside it I have some subfolders that are set up as applications in IIS 7. Within the main domain I have created subdomains that redirect to applications / folders. Ex: www.domain.com subdomai...
asked by 21.01.2014 / 18:38
1
answer

What are the best practices for implementing DryIoc, FluentValidation and Lazy?

I'm building an architecture based on the use of Lazy, DryIoc e o FluentValidation . I intend to do all validations with the object. When I actually use the object I will instantiate it (Start). I do not know if I'm sinning in any det...
asked by 03.07.2017 / 16:14