Questions tagged as 'c#'

2
answers

How to structure a solution separating WebApi from WebUI using ASP.NET Identity?

How should a solution be organized that will have at least three projects, such as: Class Library as Infrastructure Web Application as Web Api MVC Web Application for WebUI (user interface) Where ASP.NET Identity will be used as an au...
asked by 20.11.2014 / 01:58
1
answer

Convert data datetime to dd / MM / yyyy

I have a GridView and I'm using TemplateField to display the date that is currently in the format 'string yyyy-MM-dd 00: 00: 00'. > I need to show this date only with dd/MM/yyyy . I have already tried {0:dd/MM/yyyy} and it doe...
asked by 25.05.2015 / 22:27
5
answers

How to read data from the MySQL database of an application in C #?

I have a table with 2 columns in phpmyadmin, I can connect and read one column but the other does not, it gives the following error   An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll   Additio...
asked by 07.12.2015 / 02:30
2
answers

Reflection C #, how does it work?

I'm doing some testing with reflection , I made this code on the basis of trial and error, so I did not understand how exactly it works. This is the enum I'm using: public enum TipoDoAmbiente { [System.Xml.Serialization.XmlEnum...
asked by 23.09.2016 / 01:04
2
answers

Performative difference of Any () and Count ()

When I need to check whether a collection has elements which of the two methods will be faster, .Count() =! 0 or .Any() ? I've heard that .Count() may be faster in some cases. But by checking the source code , the metho...
asked by 11.08.2015 / 18:33
2
answers

Find item in a list using LINQ

I have a list and I want to search it (as if it were a database). Is it possible? Ex: list all list names starting with 'JOAO%'     
asked by 19.01.2017 / 12:58
2
answers

.NET Code Protection

I have a C # application that I developed, it will be installed on multiple clients. The problem is that I have to protect the code of the application, because I did some tests with the application ILspy and all the source code is exposed. Anyon...
asked by 20.07.2016 / 19:42
2
answers

Partially update model with WebAPI2

I'm starting to develop a REST API using ASP.NET WebAPI2. In my controller , I'm using the PATCH method to apply partial changes to a model . I have a method that looks this way [HttpPatch] [ResponseType(typeof(void)...
asked by 12.02.2016 / 19:18
1
answer

What is the difference between virtual and abstract methods?

In which cases should I prefer to use one type instead of the other?     
asked by 13.10.2016 / 17:34
2
answers

How do I know when the user opened an application?

How do I check, while my program is running, if a particular software is opened by the user?     
asked by 15.02.2014 / 21:40