private async Task <T> RunOnDb <T>(Func <PostCommentContext, Task <T> > func)
 {
     using (var context = new PostCommentContext())
     {
         return(await func(context));
     }
 }
 private async Task RunOnDb(Func <PostCommentContext, Task> func)
 {
     using (var context = new PostCommentContext())
     {
         await func(context);
     }
 }
Exemplo n.º 3
0
 public C(ICommentOptions options, IYouTubeLibeServer server, YouTubeLiveSiteOptions siteOptions, ILogger logger, IUserStore userStore, string clientIdPrefix, string sej, string sessionToken)
     : base(logger, new CookieContainer(), options, server, siteOptions, new Dictionary <string, int>(), new System.Collections.Generic.SynchronizedCollection <string>(), new Mock <ICommentProvider>().Object, userStore)
 {
     PostCommentContext = new PostCommentContext
     {
         ClientIdPrefix = clientIdPrefix,
         Sej            = sej,
         SessionToken   = sessionToken,
     };
 }
Exemplo n.º 4
0
 public PostService(PostCommentContext dbContext)
 {
     _context = dbContext;
     _context.Database?.EnsureCreated();
 }