public async void Delete_Blog_Test() { var deleteModel = (await blogarticleServices.Query(d => d.btitle == "xuint test title")).FirstOrDefault(); Assert.NotNull(deleteModel); var IsDel = await blogarticleServices.Delete(deleteModel); Assert.True(IsDel); }
public async Task <object> TestMutiDBAPI() { // 从主库(Sqlite)中,操作blogs var blogs = await _blogarticleServices.Query(d => d.Id == 1); // 从从库(Sqlserver)中,获取pwds var pwds = await _passwordLibServices.Query(d => d.PLID > 0); return(new { blogs, pwds }); }
public async Task <MessageModel <List <blogarticle> > > GetBlogsByTypesForMVP(string types = "", int id = 0) { if (types.IsNotEmptyOrNull()) { var blogs = await _blogarticleServices.Query(d => d.bcategory != null && types.Contains(d.bcategory) && d.IsDeleted == false); return(new MessageModel <List <blogarticle> >() { msg = "获取成功", success = true, response = blogs }); } return(new MessageModel <List <blogarticle> >() { }); }
public async Task Run(IJobExecutionContext context, int jobid) { var list = await _blogarticleServices.Query(); if (jobid > 0) { var model = await _tasksQzServices.QueryById(jobid); if (model != null) { model.RunTimes += 1; var separator = "<br>"; model.Remark = $"【{DateTime.Now}】执行任务【Id:{context.JobDetail.Key.Name},组别:{context.JobDetail.Key.Group}】【执行成功】{separator}" + string.Join(separator, StringHelper.GetTopDataBySeparator(model.Remark, separator, 9)); await _tasksQzServices.Update(model); } } await Console.Out.WriteLineAsync("博客总数量" + list.Count.ToString()); }