Questions tagged as 'c#'

1
answer

How to create a composite index in SQLite via Microsoft.EntityFrameworkCore.SQLite?

I'm trying to create a single compound index, but I do not know how to do this in Microsoft.EntityFrameworkCore.SQLite , I'm used to working only with Doctrine and Hibernate and I'm totally lost. This is my template class:...
asked by 05.01.2017 / 16:00
1
answer

How to resize image independent of size?

Follow the code below: public FileContentResult Foto_Pequeno() { byte[] byte_image = null; string query = "SELECT * FROM Imagem WHERE Id = '1'"; using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn...
asked by 03.01.2017 / 20:10
1
answer

Insert indented text in TextArea with CodeMirror

I'm doing a HTML editor in the browser, where the user can write his script to the database, I recorded all the lines of user code in a single string and recorded it in the DB, but how do I bring it back as user created? Currently it l...
asked by 09.01.2017 / 22:47
1
answer

Interface freezes while loading an event

I made an event with a lot of time-consuming operations and that I need to be describing the operations in a RichTextBox, so I use RichTextBox.AppendText ("Something"), but what I wrote only appears when the method finalizes everything. I made a...
asked by 14.05.2017 / 23:05
1
answer

Static properties and memory release

I have some doubts regarding the release of resources for cases where my modifiers are static. My project is unit testing and I'm using Selenium for the first time. public class LoginTest : Base { [ClassInitialize] public st...
asked by 19.05.2017 / 16:46
1
answer

In terms of performance, what is the best way to declare a variable that will be used in various Actions / Methods in a class?

Which way is better performatically speaking? Which way do you recommend and why? //Modo 1 MeuManager mm = new MeuManager(); JsonResponse MetodoDOIS(string urlImagem) { var abc = mm.Lista(); } JsonResponse MetodoUM(ImageUploadContent...
asked by 19.05.2017 / 15:12
1
answer

Async method returning a Liststring how to use?

I have a method called consulta_usuario_email , which is responsible for searching the registered users table, the emails of the users of a certain department: public async Task<List<string>> consulta_usuario_email(string de...
asked by 05.07.2017 / 17:22
1
answer

How to put € symbol in DataGridView

I have a DataGridView with numeric values and some of them represent monetary values, but the database comes just the number and wanted to put the currency symbol in front of the value. This is the code I use to load my DataGridView; public...
asked by 08.07.2017 / 13:02
1
answer

Operation of Request.Files;

I have an Asp .Net MVC project, with a form in View that sends files to the Controller . In control I retrieve the files as follows: var myFiles = Request.Files; I do not save the file, I just read the contents. The question is: Wh...
asked by 10.07.2017 / 14:07
1
answer

What does each thing do in this method? (Mirror Audit in the Entity Framework)

Well, following this great Gypsy answer , where he implements a Mirror Audit , where the following method is implemented in DbSaveChanges() : //Laço de repetição em ChangeTracker.Entries. Mas o que é ele? foreach (var entidade in Chan...
asked by 21.04.2017 / 18:59