コード例 #1
0
 public async Task <IStepModel> FindByGuiDAsync(string GuiD)
 {
     using (GuideDatabaseContext context = GuideDatabaseContextHelper <GuideDatabaseContext> .CreateContext())
     {
         return(await context.Steps.FindAsync(GuiD));
     }
 }
コード例 #2
0
 public IList <IStepModel> GetAll()
 {
     using (GuideDatabaseContext context = GuideDatabaseContextHelper <GuideDatabaseContext> .CreateContext())
     {
         return(context.Steps.ToList());
     }
 }
コード例 #3
0
 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();
     }
 }