0
I have a problem that when I have this code below:
public static String GravarNoBDFildes(List<Fildes> dados)
{
try
{
Console.WriteLine("Começando o processamento");
var inseridos = new List<Fildes>();
using (var fildesContext = new FildesContext())
{
fildesContext.Configuration.AutoDetectChangesEnabled = true;
dados.ForEach(x => {
var retorno = fildesContext.Fildess.Add(x);
inseridos.Add(retorno);
});
fildesContext.ChangeTracker.DetectChanges();
fildesContext.SaveChanges();
}
Console.WriteLine("Dados inseridos no Banco" + JsonConvert.SerializeObject(dados));
return "Processamento foi concluido";
}
}
This error occurs when I start the console project:
"Processing failed with error: An error occurred while updating the Entries. See the Inner Exception for Details.".
What would that mistake be and how can I fix it please.
start by adding a
catch(Exception ex){throw ex;}
after your Try and debug your code line by line...– Leandro Angelo