Questions tagged as 'c#'

2
answers

Project based on spa template VS2015. How the service is generated

I created a project using the SPA template in Visual Studio 2015, to learn and understand, but I found this example very complicated. Still do not understand where the service is mounted and loaded?     
asked by 18.05.2017 / 22:52
2
answers

How to get the total memory occupied by the application?

I know there's GC.GetTotalMemory , but it only shows the consumption of managed memory. Can you find full application usage?     
asked by 17.04.2017 / 14:38
1
answer

How to configure Context not to put table name in plural?

I'm in an ASP.NET MVC 5 application, setting up a DbContext class. When EF generates the database, the tables for the application objects are getting the names in the plural. For example: public System.Data.Entity.DbSet<Teste.Mode...
asked by 15.03.2014 / 22:50
3
answers

Where dynamic Linq to SQL

I need to mount a where clause with the field and the dynamic value, for example, in pure SQL would be: WHERE :CAMPO = :VALOR However, scouring the queries I could not find anything specific, I'm already doing queries in the database...
asked by 26.04.2016 / 21:04
2
answers

Make Regex.Split in between "..."

What regular expression do I use to get the comma character that is not within the "..." fields, eg: line1, "line2", "hello,world", 215, X + Y ^ ^ ^ ^ I want to get only the referrals, I'm using the expres...
asked by 15.02.2016 / 01:06
2
answers

Is it safe to use List with Parallel.ForEach?

I'm doing a doing a crawler style method that takes a string list, makes a call to a website, inserts the return into another list, and returns. My method is working, but it is very slow so I want to parallelize the calls. I searched for...
asked by 18.05.2016 / 23:40
2
answers

Best way to make class relationship

Hello, I would like to know what is the correct way to do relationship between classes of 1..N and 1 ... 1. Example: public class Pedido { public int PedidoID{get;set;} ............. } public class ItemPedido { public int ItemPedi...
asked by 14.06.2016 / 02:49
2
answers

Return DataReader to field type bool

I need to return a field that is of type bool : public List<TB_USUARIO> ListarTodos() { var strQuery = "select * from tb_usuario"; using (contexto = new Contexto()) { var retornoDataRead...
asked by 11.05.2016 / 17:36
1
answer

Linq Compare two lists of different types

I have two different lists A List<ProdutoTag> and B = List<Tag> : public class ProdutoTag { public Int64 ProdutoId { get; set; } public Int32 TagId { get; set; } public Double Peso { get; set; } public...
asked by 23.02.2016 / 18:38
2
answers

What are the advantages of parallel.ForEach in C #?

Working with C # I have seen that we have the option to work with parallel.ForEach() . What is the advantage of working with it and not foreach ?     
asked by 14.05.2016 / 03:36