Questions tagged as 'c#'

3
answers

Is there any way to interpret (parser) a connection string for an object?

There is a particular library I am using where I need to separately pass the database connection values separately: Username, Password, Host, and Database. I took this project and someone else, and I noticed that the programmer, in addition t...
asked by 06.07.2017 / 13:55
3
answers

How to handle NullReferenceException with Lambda

I have a class to search for DisplayName of my entities, where I pass the entity and class returns a list with the actual values and name of each entity attribute. My problem is when I search, and some attribute in the entity does not...
asked by 25.04.2017 / 03:43
4
answers

How to make a Hello World in ASP.NET MVC?

I already program but I'm starting with C # and ASP.NET MVC. I wanted to make a Hello World program and add things gradually as I always did with any language I've learned. I thought creating a project in Visual Studio would create a Hello...
asked by 29.12.2014 / 17:44
4
answers

Function within another

In JavaScript, I can structure my code well by putting auxiliary functions inside other functions. For example: Can I get something similar in C #? If not, how do you do not leave the auxiliary functions "loose" in the project? function Sal...
asked by 29.09.2015 / 16:54
2
answers

Format a CPF string?

I have a problem, in an app the user types the CPF, but only the numbers because it is very complicated to create a mask in Windows Phone, and that CPF will be 'drawn' in an image of a card, and to be more pleasant I need to draw it with its nor...
asked by 18.07.2015 / 23:37
2
answers

Declaration of an interface with where

I am studying a lot design pattern , as I think they solve a lot and it is very opportune to study them. I got this statement from the Macoratti website and I confess, I could not explain from where . What does that mean? public interfa...
asked by 11.07.2015 / 22:38
3
answers

How to change the structure of a LINQ query at runtime?

I have the following example of a program that implements the EF (Entity Framework). The bank and application structure is defined as follows: Table Pessoa : Primary key field: id_pessoa Field name: nome Field age:...
asked by 27.05.2016 / 01:17
3
answers

How to load a dropdown with a selected value

I have a method to perform change on some data. Among these data, I have a dropdownlist that contains the periods of the courses. When I select to change, I need the dropdown to come with the option checked, as it is in the database. I ne...
asked by 08.06.2015 / 18:56
3
answers

Faster way to access properties in a list C #

I have a project that works with a large volume of data, and I need to optimize it to bring results of some calculations in a considerably small time. I know I have several aspects to take into consideration, such as the structure in which the d...
asked by 30.03.2016 / 15:15
1
answer

Concept of class, entity and objects

I'm reading about classes in C #, and an excerpt left me a bit confused. I know that classes are C # objects, and can be used in many ways. My question is in the following sentence: "A class can have both the attributes and methods of a...
asked by 08.05.2017 / 20:20