Questions tagged as 'c#'

2
answers

Using C # 6 string interpolation

With C # 6 and using interpolation it was better to concatenate string with data. As in the example. Instead of: var d = "19"; string.Format("{0} anos", d); It looks much better $"{d} anos"; But using the resource, I created a co...
asked by 11.05.2016 / 23:20
1
answer

Differences between readonly Func and Method

Forgetting issues such as readability, what would be the differences between the following calls? readonly Func = (T1, T2) = > {return default (TResult); } private readonly Func<int, int, int> Soma = new Func<Func<int, int,...
asked by 29.04.2016 / 13:58
2
answers

How to use Windows Forms components in a WPF application?

Is there any way to use Windows Forms components in WPF? For example, do I need to use the control Chart or MaskedTextBox of Windows Forms, which does not exist in WPF applications, how could I use it in my WPF application? I le...
asked by 24.09.2016 / 03:47
1
answer

How to read data in Json on the server?

I have an Asp.Net MVC project and I am trying to reuse an Action that returns Json inside the server, but I am not able to work with Json returns in C #. I'm doing research, but I have not found anything that will help me so far. Code snip...
asked by 02.12.2015 / 20:33
1
answer

Update on 2mil records Customers how to do a single update instead of 2k separately

I have a Client Model and need to update on EnviadoEmailCobranca para 0 I'm doing this: var clientes = db.Clientes.Where(w => w.Status == 4); foreach (var item in clientes) { item.EnviadoEmailCobranca = false;...
asked by 10.03.2016 / 16:14
5
answers

How to know the number of a week in each month

I'm working on ASP MVC4, and I would like to know how many weeks in a given month to generate a list with dates. For example, the user enters a week, and in that week of each month I generate a date. The user can enter the week of the month in w...
asked by 05.02.2014 / 10:59
4
answers

List all Roles in CheckBox and mark the roles that the User has

I am creating a User Management System in Asp.net MVC 4 with two Simple Tables. Users and Roles. I can create the users normally by selecting the Roles that they will have. At Edit time I'm trying to list all the Roles in CheckBox and c...
asked by 19.02.2014 / 16:25
3
answers

Unmount a USB Pen-Drive via Code

I would like to know how I can do to unmount a removable drive (Pen-Drive) via C # code.     
asked by 21.02.2014 / 17:59
3
answers

What is the most correct way to query with LINQ?

I'm trying to make a LINQ query on my DB SQL Server, but its result always comes 'null'. I need the first userid on which I query. This is the way I try to query it: public decimal GetCustomerBalance(long accountCurrentAdvisorId) {...
asked by 11.04.2015 / 05:46
4
answers

How do I implement an ObjectSet wrapper that works with LinqToEntities?

I need to create a wrapper for ObjectSet to be able to create a centralized access control. The goal is to implement the CA without making changes to queries already in the system, which in this case are scattered throughout the code...
asked by 06.02.2014 / 13:51