Questions tagged as 'c#'

1
answer

How can I test authenticated webservice?

Hello, I have an authentication service already mounted in C # and wanted to do any testing with it. It can be some webform page, which returns a positive or negative, or a C # class even though it runs on console and does the same. Already have...
asked by 03.02.2015 / 02:49
1
answer

Receiving data via serial connection C #

I need to make a program that has to send a command to a radio connected via serial port and it returns its ID. The connection to the port and the sending of data is okay, when I send something the light flashes. However I need your feedback and...
asked by 19.06.2015 / 20:49
1
answer

Problem saving a change using Entity Framework

I'm trying to persist a change I make in a registry, but I'm getting this error:    System.InvalidOperationException: 'A referential integrity constraint   violation occurred: The property value (s) of   'UnitMedida.UndMedidaId' on one end of...
asked by 31.05.2017 / 15:19
1
answer

Controller returning partial view in a modal

I have a button on my screen that held call to a method in my controller (Ajax) that returns a partialView by default. $("#btn-Visualizar-Rotina").click(function() { var codUnimetPcp = '@Model.UnidadeMetalica.COD_UNIMET_PCP';...
asked by 28.07.2016 / 22:21
4
answers

Why use the using block in ASP.NET MVC?

Does the using {} block work in the same way in both web and desktop applications in the sense that when we use it in controller ? It is a good practice to declare it in actions that there is contact with database Follow exam...
asked by 21.10.2015 / 18:09
3
answers

Why declare properties twice in a class?

When declaring a property in a class, they usually declare twice, one public and the other private. What is the purpose? private int _years; public int Years { get { return _years; } }     
asked by 17.05.2017 / 18:39
2
answers

Selecting a value from a row / column of the ListView populated by LINQ to SQL

Through the double click event I need to pull a value from a row / column in a ListvView populated by LINQ to SQL. For example, when the user needs to select a row / column value from this ListView, after the double-click event, this informati...
asked by 23.01.2016 / 21:43
1
answer

Fluent NHibernate - key mapping composed one to many

I'm having a problem mapping an entity to Fluent NHibernate . I have a 1-N relationship with the two tables in the bank having composite keys. When I try to list my User entity it returns an error, but this happens only when I create th...
asked by 20.05.2016 / 18:37
1
answer

Use of predicate and lambda expression

I am studying WPF and the MVVM template by the following article: link In the implementation of the ICommand interface, the author defines the following field: Predicate<object> _canExecute; When the class is insta...
asked by 20.05.2016 / 23:55
1
answer

Capturing sound from a microphone in Windows via C #

How do I capture the audio that the microphone receives in Windows with C #? I want to develop a software that receives external sound and based on it it changes the volume of my computer.     
asked by 29.01.2016 / 17:21