Questions tagged as 'c#'

1
answer

Login with facebook on Xamarin Forms with Azure Mobile Apps

I'm building an app (with xamarin.forms pcl ), where I have a facebook login using the Azure Mobile Client SDK . It is possible to perform the authentication, however, soon after the authentication, I try to make a listing in the api url: lin...
asked by 01.06.2017 / 04:14
1
answer

Error when trying to insert DateTime.MinValue into the database

I have an object that has a DateTime property, and I initialize it with the value of the DateTime.MinValue property The problem is that passing this value to register in the SQL Server database gives an error:    SqlDateTime overflow. Must...
asked by 10.05.2017 / 16:55
1
answer

Regex for capturing fixed strings in HTML and JS codes [closed]

I am doing some automated testing for a legacy project in the MVC template, however there is a requirement for one of them that is capturing all fixed strings in HTML and JS codes. Since the project company is undergoing an internationalizatio...
asked by 11.05.2017 / 17:37
3
answers

More attributes in AppSettings

Is it possible to add other values to AppSettings without breaking with the application? Default values: <appSettings> <add key="Nome" value="ValorTeste" /> </appSettings> I would like to leave it like this...
asked by 03.05.2017 / 19:30
1
answer

Edit object with related objects

I have an object Cliente that relates to two other objects. [Table("Cliente")] public class Cliente { [StringLength(100, ErrorMessage = "Este campor permite apenas 100 caracteres"), Required] public String Nome { get; set; } ......
asked by 08.05.2017 / 14:23
1
answer

The 'connection' object can be dropped more than once in the method

Follow the code: public ActionResult Index(ViewModel model, string returnUrl) { string query = "UPDATE Table SET Status = 'C' WHERE Id = @Num"; using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings...
asked by 07.05.2017 / 05:09
1
answer

How to add properties to WPF components?

I can use System.Windows.Controls.TextBox as an example. How do I add more behaviors and properties to it? In a real context, I would like the TextBox component to have a boolean property HasErrors , which if set to true,...
asked by 19.02.2017 / 16:48
1
answer

What is the purpose and use of the GuidAttribute?

I know the GUID is a 'unique' identifier, but I do not see the why of your application's attribute, as in the example below: [GuidAttribute("C281C7F1-4AA9-3517-961A-463CFED57E75")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]...
asked by 19.02.2017 / 13:45
1
answer

Inserting and updating data in N-N tables (many for many)

I'm having trouble saving in a many-to-many relationship, follow my template: public class Pessoa { public int id { get; set; } public string descricao { get; set; } public ICollection<Conta> Conta { get; set; } } public cl...
asked by 02.02.2017 / 20:50
1
answer

Query using Entityframework Why performance variation?

I have the following querys using Linq to Object: _Context.GerenciaTransacao.Where(x => x.Placa == "LUN1320").ToList(); In this query, results return in 100ms. and string placa = "LUN1320"; _Context.GerenciaTransacao.Where(x =>...
asked by 14.02.2017 / 15:59