Questions tagged as 'c#'

1
answer

Consume SOAP from a rest in Asp.Net Core 2.0

I refined the question, trying to improve it for better understanding. 1) I created a WCF service, called OptOutService.svc. In this service I have an interface and a class that implements this interface, as below: [ServiceContract] public...
asked by 22.06.2018 / 15:07
1
answer

WPF select all CheckBox DataGrid

Hello, I'm trying to select all CheckBoxes from a datagrid but I'm not succeeding. Below is my code to select: private void CheckUnCheckAll(object sender, RoutedEventArgs e) { CheckBox chkSelectAll = ((CheckBox)sender); if (chkSelect...
asked by 23.02.2018 / 21:02
1
answer

How to use regular expression without using the Regex class?

I need to validate the input of values and strings, however I have questions about how to use without using the Regex class, how can I get the solution? var CampoExpressao = new Regex(@"[0-9]"); Above is a regular expression example code....
asked by 04.05.2018 / 02:06
1
answer

Turning the HttpResponseMessage return into JSON

My API currently returns the bank values in JSON. If no value is found, I return a HttpResponseMessage with error code 404. However, when testing the request, only the message contained in Content is displayed. I would lik...
asked by 14.02.2018 / 18:44
3
answers

Send information from a Data grid Viwer to sql database [closed]

I am putting together an order form using C # . The problem is that when I try to send the products that are listed in the Data Grid Viewer to the database, the program reads only the line where the cursor is. I know I need a foreach...
asked by 24.04.2018 / 03:04
1
answer

Difference between AddMvc vs AddMvcCore

In some examples I've been tracking, I've found two calls in Startup of applications in asp.net-core AddMvc: public void ConfigureServices(IServiceCollection services) { services.AddMvc() } AddMvcCore: public void...
asked by 22.04.2018 / 19:29
2
answers

Select columns dynamically with Linq

I have an action in an API that should return a template, however the fields that must be returned are entered in the request. I can query with the System.Linq.Dynamic.Core package, but the performance is pretty bad. What other alternative can I...
asked by 09.10.2018 / 18:50
2
answers

Razor language regionality

I'm having a problem with Razor (using MVC 2.1 .Net Core) when generating the screen, as below code, it is appearing the correct date in my Local development environment, but after Publish appears in English in other environments, could you forc...
asked by 09.10.2018 / 20:36
1
answer

Deserialize List JSON C #

In my program I make a GET and get the following: {"totalcount":2,"count":2,"sort":1,"order":"ASC","data":[{"2":8283,"1":"Teste","12":6,"15":"2018-03-29 11:30:04","19":"2018-03-29 15:13:18","10":5,"4":981,"5":981,"8":null,"159":0,"7":"Others...
asked by 02.04.2018 / 12:34
1
answer

How to call a javaScript Function in C #

var inputElements = webBrowser1.Document.GetElementsByTagName("input"); foreach (HtmlElement i in inputElements){ if(i.GetAttribute("name").Equals("user")){ i.InnerText = "Teste"; } if...
asked by 29.03.2018 / 02:34