Questions tagged as 'c#'

1
answer

How can I insert these characters into C #

How can I insert these characters into C # ┍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍┑ │ │ │ │ │ │ │...
asked by 27.07.2017 / 13:11
1
answer

How to create a foreign key in a table where data already exists, in the EntityFramework with Code-First?

I have a system already in production from which the customer has requested a modification. Modification is the creation of an EMPLOYEE table that will relate to the DRIVE table, creating a 1: N relationship (One Employee, multiple DRIVES)....
asked by 10.04.2015 / 22:37
1
answer

What is a TT extension file for?

Well, I was searching the internet for a way to create a string as template , based on a template file. I came across a response from SOEN that talks about .tt files, to use a template at "runtime". I'd like to know more about...
asked by 27.07.2018 / 17:29
1
answer

How to list products from a single restaurant?

I have registered my products at a particular restaurant. Being Restaurant (1) and Products (N), I have several products registered in a restaurant. How do I list these products for each restaurant? This is the default Action: public Act...
asked by 28.09.2016 / 05:23
1
answer

Problems with accentuation when reading JSON file data

The method below is extracting data from a JSON file, to populate a DropDownList. public static List<Uf> GetAll() { var client = new WebClient(); JsonSerializerSettings settings = new JsonSerializerSettings(); settings.Culture = ne...
asked by 10.10.2016 / 21:30
3
answers

Is there any class in C # for manipulating properties files?

In C # you have some class for handling files properties ? In java I use the class Properties , wanted to know if it has an equivalent in C #?     
asked by 08.10.2016 / 20:45
2
answers

How to use the IN clause in Lambda?

There was a doubt that I thought would be easy, but the content I found I could not understand. Good is as follows: I have the tables    "Customer" and    "ErrorsProducao_Ciente" where they relate 1 to N, that is, 1 error can af...
asked by 12.09.2016 / 19:43
1
answer

Using ToUInt64 to format string is correct?

Looking for a practical way to format string I came across the following: Convert.ToUInt64(string).ToString(@"00000\-000") . Is it a good practice to use this method to format strings ? Is there a recommended way? Here...
asked by 10.08.2016 / 22:48
1
answer

Encrypt App.Config

I'm trying to encrypt my connection string , which is in my app.config . After reading some forums, I saw that 2 methods need to be created: class proteger_app { public static void Criptografar() { Configuration confi...
asked by 26.07.2016 / 22:26
1
answer

Purpose of the lambda syntax in function / method

In some cases a function / method contains only one line in its scope, see the illustrative example: static int Soma(int a, int b) { return a + b; } However, the new feature in C # 6.0 which allows declaring a function / method in lam...
asked by 22.07.2016 / 19:31