Example #1
0
        public async Task <ApiResult <string> > Delete(int id)
        {
            var r = new ApiResult <string>();

            try
            {
                var isExist = await _blogArticleServices.IsExist(id);

                if (isExist)
                {
                    r.status = await _blogArticleServices.DeleteById(id) > 0 ? 200 : 400;

                    r.msg = r.status == 200 ? "删除成功" : "删除失败";
                }
                else
                {
                    r.status = 400;
                    r.msg    = "未匹配到数据";
                }
            }
            catch (Exception ex)
            {
                r.status = 500;
                r.msg    = ex.Message;
            }
            return(r);
        }
        public async Task Handle(BlogDeletedIntegrationEvent @event)
        {
            _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, "BiliFor", @event);

            ConsoleHelper.WriteSuccessLine($"----- Handling integration event: {@event.Id} at BiliFor - ({@event})");

            await _blogArticleServices.DeleteById(@event.BlogId.ToString());
        }
Example #3
0
 public async Task <Boolean> Delete(Int32 id)
 {
     return(await blogArticleServices.DeleteById(id));
 }