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