public async Task CreateAsync(DocumentationBusinessTypeTemplate documentToAdd) { Stopwatch timespan = Stopwatch.StartNew(); try { db.DocumentationBusinessTypeTemplates.Add(documentToAdd); await db.SaveChangesAsync(); timespan.Stop(); log.TraceApi("SQL Database", "DocumentationBusinessTypeTemplateRepository.CreateAsync", timespan.Elapsed, "documentToAdd={0}", documentToAdd); } catch (Exception e) { log.Error(e, "Error in DocumentationBusinessTypeTemplateRepository.CreateAsync(documentToAdd={0})", documentToAdd); throw; } }
public async Task UpdateAsync(DocumentationBusinessTypeTemplate documentToSave) { Stopwatch timespan = Stopwatch.StartNew(); try { db.Entry(documentToSave).State = EntityState.Modified; await db.SaveChangesAsync(); timespan.Stop(); log.TraceApi("SQL Database", "DocumentationBusinessTypeTemplateRepository.UpdateAsync", timespan.Elapsed, "documentToSave={0}", documentToSave); } catch (Exception e) { log.Error(e, "Error in DocumentationBusinessTypeTemplateRepository.UpdateAsync(documentToSave={0})", documentToSave); throw; } }
public async Task <DocumentationBusinessTypeTemplate> FindDocumentationBusinessTypeTemplatesByIDAsync(int documentationBusinessTypeTemplateID) { DocumentationBusinessTypeTemplate docuBusinessType = null; Stopwatch timespan = Stopwatch.StartNew(); try { docuBusinessType = await db.DocumentationBusinessTypeTemplates.FindAsync(documentationBusinessTypeTemplateID); timespan.Stop(); log.TraceApi("SQL Database", "DocumentationBusinessTypeTemplateRepository.FindDocumentationBusinessTypeTemplatesByIDAsync", timespan.Elapsed, "documentationBusinessTypeTemplateID={0}", documentationBusinessTypeTemplateID); } catch (Exception e) { log.Error(e, "Error in DocumentationBusinessTypeTemplateRepository.FindDocumentationBusinessTypeTemplatesByIDAsync(documentationBusinessTypeTemplateID={0})", documentationBusinessTypeTemplateID); throw; } return(docuBusinessType); }