public async Task <IStepModel> FindByGuiDAsync(string GuiD)
 {
     using (GuideDatabaseContext context = GuideDatabaseContextHelper <GuideDatabaseContext> .CreateContext())
     {
         return(await context.Steps.FindAsync(GuiD));
     }
 }
 public IList <IStepModel> GetAll()
 {
     using (GuideDatabaseContext context = GuideDatabaseContextHelper <GuideDatabaseContext> .CreateContext())
     {
         return(context.Steps.ToList());
     }
 }
 public async void UpdateAsync(IStepModel step)
 {
     using (GuideDatabaseContext context = GuideDatabaseContextHelper <GuideDatabaseContext> .CreateContext())
     {
         context.Steps.Update(step);
         await context.SaveChangesAsync();
     }
 }
예제 #4
0
 public async void UpdateAsync(IChapterMapModel chapterMap)
 {
     using (GuideDatabaseContext context = GuideDatabaseContextHelper <GuideDatabaseContext> .CreateContext())
     {
         context.ChapterMaps.Update(chapterMap);
         await context.SaveChangesAsync();
     }
 }
예제 #5
0
 public async void DeleteAsync(IChapterModel chapter)
 {
     using (GuideDatabaseContext context = GuideDatabaseContextHelper <GuideDatabaseContext> .CreateContext())
     {
         context.Chapters.Remove(chapter);
         await context.SaveChangesAsync();
     }
 }