Questions tagged as 'c#'

1
answer

Persisting in batch in Many-to-Many Entity with extra fields

I have the following question: If I have a relationship N for N ex: Products and Coins. Whenever it persists, there would be 1 Product with a list of 10 Coins. public class Produto { public int ProdutoId { get; set; } public string Nom...
asked by 17.05.2017 / 18:42
1
answer

Lambda - how to use the || (OR) in an .Any ()

What would be the correct way to implement the line below in Lambda ? ListaDeRespostasPossiveis.Any(x => x.Nome == "respostaUm" || x.Nome == "respostaDois") I saw some examples in Stack Overflow in English, but I did not find it for the...
asked by 18.05.2017 / 01:33
1
answer

C # How to send numericUpDown value to textBox in Hexadecimal?

then ... numericUpDown even has the Hexadecimal count format, however when sending to texBox it counts only in decimal is there any way the textBox can get the given numeric value in Hexadecimal? I send the numeric value to the textBox like t...
asked by 26.03.2017 / 23:28
1
answer

How can I read custom attributes without reflection?

I have the following code snippet: [Campo(Chave=true)] public System.Guid EscalaId { get; set; } I know that I can read these tributes using the MemberInfo class, as the example in the documentation says: System.Reflection.MemberIn...
asked by 05.05.2017 / 22:49
1
answer

Center a label on a badge

I can not centralize a label inside a badge. It looks like the label is out of the badge. See the code: <Grid xmlns="http://xamarin.com/schemas/2014/forms" xmlns:local="clr-namespace:Operacional" xmlns:x="http:/...
asked by 26.02.2018 / 20:58
2
answers

Parameter error in MySQL with C #

string sql = @"UPDATE ivendas SET nritem=(@rank:=(@rank+1)) where id_venda = 20"; try { MySQLBase basemysql = new MySQLBase(); MySqlCommand cmd = basemysql.connection.CreateCommand(); cmd.CommandText = sql; cmd.CommandTimeout = 10...
asked by 16.01.2018 / 18:37
1
answer

C # Application Console. Read file Json

I have a Json file and it always goes wrong when I try to read it. I think because it's an array inside another array and I can not read it. Json: { "map": [ ["S", "S", "S", "S"], ["S", "S", "C", "S"], [ "S", "S", "S", "S" ],...
asked by 31.01.2018 / 13:37
1
answer

If I have two servers (application and database) with different time zones, which one is better to use as a base?

I am working with the MySQL server of a hosting, I can not change the time zone of the same, ie it uses the "Mountain Standard time (MST)", on the other hand, I am using the ASP.NET server and in it I can set the time zone for "Brasilia Timetabl...
asked by 10.01.2018 / 18:49
1
answer

Execute log method every time ASP.NET MVC (Exception Handling)

I need to implement Error Logging in my ASP.NET MVC application, , My question is as follows, is there any way I can trigger a method (would this be a method that would write the error log, e-mail, and the like exception handling) whenever an E...
asked by 15.01.2017 / 19:14
1
answer

FuncT, bool and ExpressionFuncT, bool

I'd like to know first what the difference between Func<T, bool> to Expression<Func<T, bool>> And how do I convert from Func<T, bool> to Expression<Func<T, bool>> if it's possibl...
asked by 22.03.2016 / 12:15