Questions tagged as 'c#'

1
answer

WebClientDownloadFileTaskAsync file in use, even with Dispose

I'm downloading 10 images at the same time async, but in the 2nd photo usually the error that the image is in use.    The process can not access the file because it is being used by   another process. I already think it's strange, because...
asked by 20.10.2016 / 13:48
1
answer

Call Partial with IEnumerable within a page that has its IEnumerable asp.net mvc?

In my layout I have an option where I show some notifications, so include a partial layout in the layout: @Html.Partial("_PartialNotificacoes") @model IEnumerable<Generico.Dominio.TB_NOTIFICACAO> @if (Model.Count() > 0) { fo...
asked by 22.10.2016 / 21:40
1
answer

For nested in parallel

I am trying to rotate two% nested%. The second would like it to be parallel. Follow my code. for (int i = 0; i < original.Width; i++) { Parallel.For(0, original.Height, j => { Color originalColor = origina...
asked by 02.12.2016 / 13:26
1
answer

Request performance using Html.BeginForm versus jQuery AJAX

Is there any gain in performance when using jQuery to perform ajax requests in relation to the post using Html.BeginForm? @using (Html.BeginForm("Create", "Teste") { @Html.AntiForgeryToken() @Html.ValidationSummary(true, ""...
asked by 01.12.2016 / 07:25
1
answer

Error loading page CREATE

I have two related methods. Patrimonio and Categoria : [Table("Patrimonios")] public class Patrimonio { [Key] public Guid PatrimonioId { get; set; } public Guid CategoriaId { get; set; } [Required] [StringLen...
asked by 01.12.2016 / 04:08
1
answer

Programmatically change the date displayed in a DatePicker control?

I'm trying to display data from a field of a MySQL table in a DatePicker control. The code is as follows: if (dataGridProdutos.SelectedIndex != -1) { DateTime selectedDate; DataRowView selectedRecord = (DataRowView)dataGr...
asked by 01.12.2016 / 19:38
1
answer

Nested for thread conversion

I have the following% nested for that runs the entire length of a bitmap image in C #. I would like to run the second for threads to run parallel. Bitmap alterado = new Bitmap(original.Width, original.Height); //Convertendo para to...
asked by 01.12.2016 / 19:11
1
answer

LINQ to SQL - Exception when giving sum () in a query that contains another subquery using LINQ

private decimal GetBankAccountCashierTotal() { var company = _context.Company.FirstOrDefault(); return _context.PersonBankAgencyAccount .Where(p => p.PersonID.Equals(company.PersonID)) .Wh...
asked by 01.12.2016 / 16:30
1
answer

Using model annotations for C #

I have this annotation in my model [ZoneamentoDados(fim = 2, inicio = 1, tamanho = 2, obs = "Tipo Registro")] public String tipoRegistro { get; set; } [ZoneamentoDados(fim = 54, inicio = 54, tamanho = 1, obs = "Sempre 1")] I need to use the...
asked by 16.01.2017 / 13:17
1
answer

How to join two different lists using LINQ and where?

I have three classes: class Cid { public string cid { get; set; } //importo esse campo via txt public string descricao { get; set; } //importo esse campo via txt } class Relacionamento { public string cid { get; set;...
asked by 19.01.2017 / 15:51