Преглед на файлове

移除多余的程序包

懒得勤快 преди 6 години
родител
ревизия
2ee4547f9d
променени са 21 файла, в които са добавени 23 реда и са изтрити 71 реда
  1. 1 0
      src/Masuit.MyBlogs.Core/Controllers/AdvertisementController.cs
  2. 1 1
      src/Masuit.MyBlogs.Core/Controllers/CommentController.cs
  3. 1 0
      src/Masuit.MyBlogs.Core/Controllers/DonateController.cs
  4. 1 0
      src/Masuit.MyBlogs.Core/Controllers/FileController.cs
  5. 1 0
      src/Masuit.MyBlogs.Core/Controllers/HomeController.cs
  6. 1 0
      src/Masuit.MyBlogs.Core/Controllers/MergeController.cs
  7. 1 1
      src/Masuit.MyBlogs.Core/Controllers/MsgController.cs
  8. 1 0
      src/Masuit.MyBlogs.Core/Controllers/SearchController.cs
  9. 1 0
      src/Masuit.MyBlogs.Core/Controllers/SeminarController.cs
  10. 1 0
      src/Masuit.MyBlogs.Core/Controllers/SubscribeController.cs
  11. 1 0
      src/Masuit.MyBlogs.Core/Controllers/SystemController.cs
  12. 1 0
      src/Masuit.MyBlogs.Core/Extensions/FirewallAttribute.cs
  13. 0 1
      src/Masuit.MyBlogs.Core/Extensions/Hangfire/HangfireBackJob.cs
  14. 2 1
      src/Masuit.MyBlogs.Core/Hubs/MyHub.cs
  15. 7 22
      src/Masuit.MyBlogs.Core/Infrastructure/Repository/BaseRepository.cs
  16. 0 13
      src/Masuit.MyBlogs.Core/Infrastructure/Repository/Interface/IBaseRepository.cs
  17. 0 17
      src/Masuit.MyBlogs.Core/Infrastructure/Services/BaseService.cs
  18. 1 0
      src/Masuit.MyBlogs.Core/Infrastructure/Services/CategoryService.cs
  19. 0 11
      src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IBaseService.cs
  20. 0 2
      src/Masuit.MyBlogs.Core/Masuit.MyBlogs.Core.csproj
  21. 1 2
      src/Masuit.MyBlogs.Core/Program.cs

+ 1 - 0
src/Masuit.MyBlogs.Core/Controllers/AdvertisementController.cs

@@ -6,6 +6,7 @@ using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.MyBlogs.Core.Models.ViewModel;
+using Masuit.Tools;
 using Masuit.Tools.Core.Net;
 using Microsoft.AspNetCore.Mvc;
 using System;

+ 1 - 1
src/Masuit.MyBlogs.Core/Controllers/CommentController.cs

@@ -6,6 +6,7 @@ using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.MyBlogs.Core.Models.ViewModel;
+using Masuit.Tools;
 using Masuit.Tools.Core.Net;
 using Masuit.Tools.Html;
 using Microsoft.AspNetCore.Hosting;
@@ -15,7 +16,6 @@ using Microsoft.EntityFrameworkCore.Internal;
 using Microsoft.Net.Http.Headers;
 using System;
 using System.Collections.Generic;
-using System.IO;
 using System.Linq;
 using System.Text.RegularExpressions;
 

+ 1 - 0
src/Masuit.MyBlogs.Core/Controllers/DonateController.cs

@@ -1,5 +1,6 @@
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.Entity;
+using Masuit.Tools;
 using Microsoft.AspNetCore.Mvc;
 using System;
 using System.Linq;

+ 1 - 0
src/Masuit.MyBlogs.Core/Controllers/FileController.cs

@@ -1,5 +1,6 @@
 using Masuit.MyBlogs.Core.Common;
 using Masuit.MyBlogs.Core.Models.ViewModel;
+using Masuit.Tools;
 using Masuit.Tools.AspNetCore.ResumeFileResults.Extensions;
 using Masuit.Tools.Files;
 using Masuit.Tools.Logging;

+ 1 - 0
src/Masuit.MyBlogs.Core/Controllers/HomeController.cs

@@ -7,6 +7,7 @@ using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.MyBlogs.Core.Models.ViewModel;
+using Masuit.Tools;
 using Microsoft.AspNetCore.Mvc;
 using System;
 using System.Collections.Generic;

+ 1 - 0
src/Masuit.MyBlogs.Core/Controllers/MergeController.cs

@@ -8,6 +8,7 @@ using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
+using Masuit.Tools;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Mvc;
 using System;

+ 1 - 1
src/Masuit.MyBlogs.Core/Controllers/MsgController.cs

@@ -6,6 +6,7 @@ using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.MyBlogs.Core.Models.ViewModel;
+using Masuit.Tools;
 using Masuit.Tools.Core.Net;
 using Masuit.Tools.Html;
 using Microsoft.AspNetCore.Hosting;
@@ -14,7 +15,6 @@ using Microsoft.EntityFrameworkCore.Internal;
 using Microsoft.Net.Http.Headers;
 using System;
 using System.Collections.Generic;
-using System.IO;
 using System.Linq;
 using System.Text.RegularExpressions;
 

+ 1 - 0
src/Masuit.MyBlogs.Core/Controllers/SearchController.cs

@@ -4,6 +4,7 @@ using Masuit.MyBlogs.Core.Extensions;
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
+using Masuit.Tools;
 using Microsoft.AspNetCore.Mvc;
 using System;
 using System.Collections.Generic;

+ 1 - 0
src/Masuit.MyBlogs.Core/Controllers/SeminarController.cs

@@ -4,6 +4,7 @@ using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
+using Masuit.Tools;
 using Microsoft.AspNetCore.Mvc;
 using System;
 using System.Collections.Generic;

+ 1 - 0
src/Masuit.MyBlogs.Core/Controllers/SubscribeController.cs

@@ -7,6 +7,7 @@ using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.MyBlogs.Core.Models.ViewModel;
+using Masuit.Tools;
 using Masuit.Tools.DateTimeExt;
 using Masuit.Tools.Html;
 using Masuit.Tools.Logging;

+ 1 - 0
src/Masuit.MyBlogs.Core/Controllers/SystemController.cs

@@ -172,6 +172,7 @@ namespace Masuit.MyBlogs.Core.Controllers
             {
                 CommonHelper.SystemSettings.AddOrUpdate(key, value);
             }
+
             return ResultData(null, b, b ? "设置保存成功!" : "设置保存失败!");
         }
 

+ 1 - 0
src/Masuit.MyBlogs.Core/Extensions/FirewallAttribute.cs

@@ -3,6 +3,7 @@ using Hangfire;
 using Masuit.MyBlogs.Core.Common;
 using Masuit.MyBlogs.Core.Configs;
 using Masuit.MyBlogs.Core.Extensions.Hangfire;
+using Masuit.Tools;
 using Masuit.Tools.Core.Net;
 using Masuit.Tools.Security;
 using Microsoft.AspNetCore.Http;

+ 0 - 1
src/Masuit.MyBlogs.Core/Extensions/Hangfire/HangfireBackJob.cs

@@ -6,7 +6,6 @@ using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
-using Masuit.Tools;
 using Masuit.Tools.Core.Net;
 using Microsoft.AspNetCore.Hosting;
 using System;

+ 2 - 1
src/Masuit.MyBlogs.Core/Hubs/MyHub.cs

@@ -1,4 +1,5 @@
-using Masuit.Tools.DateTimeExt;
+using Masuit.Tools;
+using Masuit.Tools.DateTimeExt;
 using Masuit.Tools.Hardware;
 using Masuit.Tools.Systems;
 using Microsoft.AspNetCore.SignalR;

+ 7 - 22
src/Masuit.MyBlogs.Core/Infrastructure/Repository/BaseRepository.cs

@@ -2,6 +2,7 @@
 using AutoMapper.QueryableExtensions;
 using EFSecondLevelCache.Core;
 using Masuit.MyBlogs.Core.Infrastructure.Repository.Interface;
+using Masuit.Tools;
 using Masuit.Tools.Systems;
 using Microsoft.EntityFrameworkCore;
 using System;
@@ -9,7 +10,6 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Linq.Expressions;
 using System.Threading.Tasks;
-using Z.EntityFramework.Plus;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Repository
 {
@@ -576,7 +576,9 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Repository
         /// <returns>删除成功</returns>
         public virtual int DeleteEntity(Expression<Func<T, bool>> @where)
         {
-            return DataContext.Set<T>().Where(@where).Delete();
+            var query = DataContext.Set<T>().Where(@where);
+            DataContext.RemoveRange(query);
+            return DataContext.SaveChanges();
         }
 
         /// <summary>
@@ -586,7 +588,9 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Repository
         /// <returns>删除成功</returns>
         public virtual async Task<int> DeleteEntityAsync(Expression<Func<T, bool>> @where)
         {
-            return await DataContext.Set<T>().Where(@where).DeleteAsync().ConfigureAwait(true);
+            var query = DataContext.Set<T>().Where(@where);
+            DataContext.RemoveRange(query);
+            return await DataContext.SaveChangesAsync();
         }
 
         /// <summary>
@@ -596,16 +600,6 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Repository
         /// <returns>添加成功</returns>
         public abstract T AddEntity(T t);
 
-        /// <summary>
-        /// 批量添加实体
-        /// </summary>
-        /// <param name="list">需要添加的实体</param>
-        /// <returns>添加成功</returns>
-        public virtual void BulkInsert(IEnumerable<T> list)
-        {
-            DataContext.BulkInsert(list);
-        }
-
         /// <summary>
         /// 统一保存数据
         /// </summary>
@@ -615,15 +609,6 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Repository
             return DataContext.SaveChanges();
         }
 
-        /// <summary>
-        /// 统一批量保存数据
-        /// </summary>
-        /// <returns>受影响的行数</returns>
-        public virtual void BulkSaveChanges()
-        {
-            DataContext.BulkSaveChanges();
-        }
-
         /// <summary>
         /// 统一保存数据(异步)
         /// </summary>

+ 0 - 13
src/Masuit.MyBlogs.Core/Infrastructure/Repository/Interface/IBaseRepository.cs

@@ -414,25 +414,12 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Repository.Interface
         /// <returns>添加成功</returns>
         T AddEntity(T t);
 
-        /// <summary>
-        /// 批量添加实体
-        /// </summary>
-        /// <param name="list">需要添加的实体</param>
-        /// <returns>添加成功</returns>
-        void BulkInsert(IEnumerable<T> list);
-
         /// <summary>
         /// 统一保存数据
         /// </summary>
         /// <returns>受影响的行数</returns>
         int SaveChanges();
 
-        /// <summary>
-        /// 统一批量保存数据
-        /// </summary>
-        /// <returns>受影响的行数</returns>
-        void BulkSaveChanges();
-
         /// <summary>
         /// 统一保存数据(异步)
         /// </summary>

+ 0 - 17
src/Masuit.MyBlogs.Core/Infrastructure/Services/BaseService.cs

@@ -751,22 +751,5 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Services
             await SaveChangesAsync();
             return entities;
         }
-
-        /// <summary>
-        /// 批量添加实体
-        /// </summary>
-        /// <param name="list">需要添加的实体</param>
-        public virtual void BulkInsert(IEnumerable<T> list)
-        {
-            BaseDal.BulkInsert(list);
-        }
-
-        /// <summary>
-        /// 统一批量保存数据
-        /// </summary>
-        public virtual void BulkSaveChanges()
-        {
-            BaseDal.BulkSaveChanges();
-        }
     }
 }

+ 1 - 0
src/Masuit.MyBlogs.Core/Infrastructure/Services/CategoryService.cs

@@ -2,6 +2,7 @@
 using Masuit.MyBlogs.Core.Infrastructure.Repository.Interface;
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.Entity;
+using Masuit.Tools;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services
 {

+ 0 - 11
src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IBaseService.cs

@@ -528,16 +528,5 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Services.Interface
         /// <param name="list">实体集合</param>
         /// <returns>添加成功</returns>
         Task<IEnumerable<T>> AddEntitiesAsync(IList<T> list);
-
-        /// <summary>
-        /// 批量添加实体
-        /// </summary>
-        /// <param name="list">需要添加的实体</param>
-        void BulkInsert(IEnumerable<T> list);
-
-        /// <summary>
-        /// 统一批量保存数据
-        /// </summary>
-        void BulkSaveChanges();
     }
 }

+ 0 - 2
src/Masuit.MyBlogs.Core/Masuit.MyBlogs.Core.csproj

@@ -70,8 +70,6 @@
     <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.0.0" />
     <PackageReference Include="WilderMinds.RssSyndication" Version="1.6.0" />
     <PackageReference Include="WinInsider.System.Net.Http.Formatting" Version="1.0.10" />
-    <PackageReference Include="Z.EntityFramework.Extensions.EFCore" Version="3.0.17" />
-    <PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="3.0.22" />
     <PackageReference Include="Z.ExtensionMethods" Version="2.1.1" />
   </ItemGroup>
 

+ 1 - 2
src/Masuit.MyBlogs.Core/Program.cs

@@ -1,11 +1,11 @@
 using Autofac.Extensions.DependencyInjection;
 using Masuit.MyBlogs.Core.Hubs;
+using Masuit.Tools;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Hosting;
 using System;
 using System.IO;
-using Z.EntityFramework.Extensions;
 
 namespace Masuit.MyBlogs.Core
 {
@@ -13,7 +13,6 @@ namespace Masuit.MyBlogs.Core
     {
         public static void Main(string[] args)
         {
-            LicenseManager.AddLicense("67;100-MASUIT", "809739091397182EC1ECEA8770EB4218");
             MyHub.Init();
             CreateWebHostBuilder(args).Build().Run();
         }