From fdd1eda9ecdbd49ccc4ef7d28b056c8aeb76a052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Mon, 6 Feb 2023 23:08:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=AF=B9=E8=B1=A1=E6=98=A0?= =?UTF-8?q?=E5=B0=84Mapper=EF=BC=8C=E7=AE=80=E5=8C=96=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E4=BB=93=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Yi.Framework.Net6/Yi.Framework.sln | 4 +-- .../Extensions/AutoMapperExtensions.cs | 34 ------------------ ...sproj => Yi.Framework.Core.Mapster.csproj} | 12 ++++--- ...ule.cs => YiFrameworkCoreMapsterModule.cs} | 8 ++--- .../Repositories/SqlsugarRepository.cs | 5 ++- .../Repositories/IRepository.cs | 9 +++-- .../Services/ApplicationService.cs | 2 +- .../Services/ReadOnlyAppService.cs | 3 ++ .../Yi.Framework.Ddd/Yi.Framework.Ddd.csproj | 2 +- .../Yi.Framework.Ddd/YiFrameworkDddModule.cs | 2 +- .../YiFrameworkSwaggerDoc.xml | 5 +++ .../module/Yi.Framework.Template/Program.cs | 1 - .../Server/ProfileTemplateProvider.cs | 19 ---------- .../School/MapperConfig/StudentProfile.cs | 23 ------------ .../Exhibition/MapperConfig/BannerProfile.cs | 24 ------------- .../Forum/DiscussService.cs | 2 +- .../Forum/MapperConfig/ArticleProfile.cs | 24 ------------- .../Forum/MapperConfig/CommentProfile.cs | 23 ------------ .../Forum/MapperConfig/DiscussProfile.cs | 24 ------------- .../Forum/MapperConfig/MyTypeProfile.cs | 23 ------------ .../Forum/MapperConfig/PlateProfile.cs | 24 ------------- .../Dictionary/DictionaryService.cs | 10 ++++-- .../Dictionary/DictionaryTypeService.cs | 14 ++++++-- .../MapperConfig/DictionaryProfile.cs | 23 ------------ .../MapperConfig/DictionaryTypeProfile.cs | 23 ------------ .../Identity/MapperConfig/DeptProfile.cs | 23 ------------ .../Identity/MapperConfig/MenuProfile.cs | 23 ------------ .../Identity/MapperConfig/PostProfile.cs | 23 ------------ .../Identity/MapperConfig/RoleProfile.cs | 23 ------------ .../Identity/MapperConfig/UserProfile.cs | 23 ------------ .../Identity/UserService.cs | 11 ++++-- .../rbac/Yi.RBAC.Domain/DomainSwaggerDoc.xml | 8 ----- .../Identity/Repositories/IUserRepository.cs | 7 ---- .../Repositories/DictionaryRepository.cs | 36 ------------------- .../Repositories/DictionaryTypeRepository.cs | 35 ------------------ .../Repositories/UserRepository.cs | 9 ----- .../School/MapperConfig/StudentProfile.cs | 23 ------------ 37 files changed, 64 insertions(+), 523 deletions(-) delete mode 100644 Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/Extensions/AutoMapperExtensions.cs rename Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/{Yi.Framework.Core.AutoMapper.csproj => Yi.Framework.Core.Mapster.csproj} (73%) rename Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/{YiFrameworkCoreAutoMapperModule.cs => YiFrameworkCoreMapsterModule.cs} (72%) delete mode 100644 Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ProfileTemplateProvider.cs delete mode 100644 Yi.Framework.Net6/src/project/Template/Yi.Template.Application/School/MapperConfig/StudentProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Exhibition/MapperConfig/BannerProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/ArticleProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/CommentProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/DiscussProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/MyTypeProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/PlateProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/MapperConfig/DictionaryProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/MapperConfig/DictionaryTypeProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/DeptProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/MenuProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/PostProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/RoleProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/UserProfile.cs delete mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Sqlsugar/Repositories/DictionaryRepository.cs delete mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Sqlsugar/Repositories/DictionaryTypeRepository.cs delete mode 100644 Yi.Framework.Net6/src/project/template/Yi.Template.Application/School/MapperConfig/StudentProfile.cs diff --git a/Yi.Framework.Net6/Yi.Framework.sln b/Yi.Framework.Net6/Yi.Framework.sln index 964974c0..83bb7f09 100644 --- a/Yi.Framework.Net6/Yi.Framework.sln +++ b/Yi.Framework.Net6/Yi.Framework.sln @@ -41,7 +41,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Uow", "src\fra EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Core.Sqlsugar", "src\framework\Yi.Framework.Core.Sqlsugar\Yi.Framework.Core.Sqlsugar.csproj", "{58F4071D-66B7-4839-A247-79AF0E4E1C8E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Core.AutoMapper", "src\framework\Yi.Framework.Core.AutoMapper\Yi.Framework.Core.AutoMapper.csproj", "{DFD34702-2EF6-4ECC-AE6E-9A1A3885BD26}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Core.Mapster", "src\framework\Yi.Framework.Core.AutoMapper\Yi.Framework.Core.Mapster.csproj", "{DFD34702-2EF6-4ECC-AE6E-9A1A3885BD26}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Office.Excel", "src\module\Yi.Framework.Office.Excel\Yi.Framework.Office.Excel.csproj", "{4EEC6607-F0D8-4277-9463-104DA7E184B6}" EndProject @@ -83,7 +83,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.RBAC.Application", "src\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.RBAC.Web", "src\project\rbac\Yi.RBAC.Web\Yi.RBAC.Web.csproj", "{0C031C7D-6F80-4559-977C-AC001036EC44}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.ThumbnailSharp", "src\module\Yi.Framework.ThumbnailSharp\Yi.Framework.ThumbnailSharp.csproj", "{60E54034-792C-4A90-BCDF-4D5FFB45089E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.ThumbnailSharp", "src\module\Yi.Framework.ThumbnailSharp\Yi.Framework.ThumbnailSharp.csproj", "{60E54034-792C-4A90-BCDF-4D5FFB45089E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/Extensions/AutoMapperExtensions.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/Extensions/AutoMapperExtensions.cs deleted file mode 100644 index c5af7d8a..00000000 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/Extensions/AutoMapperExtensions.cs +++ /dev/null @@ -1,34 +0,0 @@ - -using AutoMapper; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.Framework.Core.Helper; - -namespace Yi.Framework.Autofac.Extensions -{ - public static class AutoMapperExtensions - { - public static IServiceCollection AddAutoMapperService(this IServiceCollection services) - { - //这里会通过反射,扫码全部程序集获取继承Profile的类 - var assemblies = AppDomain.CurrentDomain.GetAssemblies().ToList(); - - var profileList = new List(); - assemblies.ForEach(a => - { - if (a.FullName is not null) - { - profileList.AddRange(AssemblyHelper.GetClassByParentClass(a.FullName, typeof(Profile))); - } - - }); - - services.AddAutoMapper(profileList.ToArray()); - return services; - } - } -} diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/Yi.Framework.Core.AutoMapper.csproj b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/Yi.Framework.Core.Mapster.csproj similarity index 73% rename from Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/Yi.Framework.Core.AutoMapper.csproj rename to Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/Yi.Framework.Core.Mapster.csproj index a909b82c..6202c43e 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/Yi.Framework.Core.AutoMapper.csproj +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/Yi.Framework.Core.Mapster.csproj @@ -6,12 +6,16 @@ enable - - - - + + + + + + + + diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/YiFrameworkCoreAutoMapperModule.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/YiFrameworkCoreMapsterModule.cs similarity index 72% rename from Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/YiFrameworkCoreAutoMapperModule.cs rename to Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/YiFrameworkCoreMapsterModule.cs index 25c819b2..396d6b3d 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/YiFrameworkCoreAutoMapperModule.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.AutoMapper/YiFrameworkCoreMapsterModule.cs @@ -1,7 +1,7 @@ -using Microsoft.AspNetCore.Builder; +using MapsterMapper; +using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using StartupModules; -using Yi.Framework.Autofac.Extensions; using Yi.Framework.Core.Attributes; namespace Yi.Framework.Core.AutoMapper @@ -9,7 +9,7 @@ namespace Yi.Framework.Core.AutoMapper [DependsOn( typeof(YiFrameworkCoreModule) )] - public class YiFrameworkCoreAutoMapperModule : IStartupModule + public class YiFrameworkCoreMapsterModule : IStartupModule { public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context) @@ -20,7 +20,7 @@ namespace Yi.Framework.Core.AutoMapper { //添加全局自动mapper - services.AddAutoMapperService(); + services.AddSingleton(); } } } \ No newline at end of file diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Repositories/SqlsugarRepository.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Repositories/SqlsugarRepository.cs index a90e2ee6..d6043e94 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Repositories/SqlsugarRepository.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Repositories/SqlsugarRepository.cs @@ -22,7 +22,10 @@ namespace Yi.Framework.Core.Sqlsugar.Repositories public SqlsugarRepository(ISqlSugarClient context) : base(context) { } - protected ISugarQueryable _DbQueryable { get { return base.AsQueryable(); } set { } } + /// + /// 注释一下,严格意义这里应该protected,但是我认为 简易程度 与 耦合程度 中是需要进行衡量的 + /// + public ISugarQueryable _DbQueryable => base.AsQueryable(); protected ISqlSugarClient _Db { get { return Context; } set { } } diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Repositories/IRepository.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Repositories/IRepository.cs index a8a31f70..b9605f86 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Repositories/IRepository.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Repositories/IRepository.cs @@ -1,4 +1,5 @@ -using System; +using SqlSugar; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; @@ -10,8 +11,12 @@ using Yi.Framework.Ddd.Entities; namespace Yi.Framework.Ddd.Repositories { - public interface IRepository + public interface IRepository { + /// + /// 注释一下,严格意义这里应该protected,但是我认为 简易程度 与 耦合程度 中是需要进行衡量的 + /// + ISugarQueryable _DbQueryable { get; } //单查 Task GetByIdAsync(dynamic id); Task GetSingleAsync(Expression> whereExpression); diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Services/ApplicationService.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Services/ApplicationService.cs index 21776251..1fe25024 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Services/ApplicationService.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Services/ApplicationService.cs @@ -1,4 +1,4 @@ -using AutoMapper; +using MapsterMapper; using Microsoft.Extensions.DependencyInjection; using Yi.Framework.Core.Model; diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Services/ReadOnlyAppService.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Services/ReadOnlyAppService.cs index 4a6f40ba..152ae845 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Services/ReadOnlyAppService.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Services/ReadOnlyAppService.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.DependencyInjection; +using SqlSugar; using System; using System.Collections.Generic; using System.Linq; @@ -39,6 +40,8 @@ where TEntityDto : IEntityDto /// protected IRepository _repository { get => ServiceLocatorModel.Instance.GetRequiredService>(); } + protected ISugarQueryable _DbQueryable => _repository._DbQueryable; + //Mapper protected virtual Task MapToGetOutputDtoAsync(TEntity entity) { diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Yi.Framework.Ddd.csproj b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Yi.Framework.Ddd.csproj index 4d82bdc4..d16d97c0 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Yi.Framework.Ddd.csproj +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Yi.Framework.Ddd.csproj @@ -10,7 +10,7 @@ - + diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkDddModule.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkDddModule.cs index 8f74be6e..0eb72f32 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkDddModule.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkDddModule.cs @@ -12,7 +12,7 @@ using Yi.Framework.Core.AutoMapper; namespace Yi.Framework.Ddd { [DependsOn( - typeof(YiFrameworkCoreAutoMapperModule) + typeof(YiFrameworkCoreMapsterModule) )] public class YiFrameworkDddModule:IStartupModule { diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkSwaggerDoc.xml b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkSwaggerDoc.xml index 651ac4e1..182fbb53 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkSwaggerDoc.xml @@ -4,6 +4,11 @@ Yi.Framework.Ddd + + + 注释一下,严格意义这里应该protected,但是我认为 简易程度 与 耦合程度 中是需要进行衡量的 + + 增 diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs index 3c9c72c6..d37d2cb9 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs @@ -37,7 +37,6 @@ foreach (var entityName in entityNames) option.Add(new GetOutputDtoTemplateProvider(modelName, entityName, nameSpaces)); option.Add(new ConstTemplateProvider(modelName, entityName, nameSpaces)); - option.Add(new ProfileTemplateProvider(modelName, entityName, nameSpaces)); //option.Add(new ApiTemplateProvider(modelName, entityName)); }); //开始构建模板 diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ProfileTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ProfileTemplateProvider.cs deleted file mode 100644 index 4c64726a..00000000 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ProfileTemplateProvider.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.Framework.Template.Abstract; -using Yi.Framework.Template.ConstClasses; - -namespace Yi.Framework.Template.Provider.Server -{ - public class ProfileTemplateProvider : ProgramTemplateProvider - { - public ProfileTemplateProvider(string modelName, string entityName, string nameSpaces) : base(modelName, entityName, nameSpaces) - { - BuildPath = $@"{TemplateConst.BuildRootPath}\{nameSpaces}.Application\{TemplateConst.ModelName}\MapperConfig\{TemplateConst.EntityName}Profile.cs"; - TemplatePath = $@"..\..\..\Template\Server\ProfileTemplate.txt"; - } - } -} diff --git a/Yi.Framework.Net6/src/project/Template/Yi.Template.Application/School/MapperConfig/StudentProfile.cs b/Yi.Framework.Net6/src/project/Template/Yi.Template.Application/School/MapperConfig/StudentProfile.cs deleted file mode 100644 index bcea70dd..00000000 --- a/Yi.Framework.Net6/src/project/Template/Yi.Template.Application/School/MapperConfig/StudentProfile.cs +++ /dev/null @@ -1,23 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.Template.Application.Contracts.School.Dtos; -using Yi.Template.Domain.School.Entities; - -namespace Yi.Template.Application.School.MapperConfig -{ - public class StudentProfile: Profile - { - public StudentProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Exhibition/MapperConfig/BannerProfile.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Exhibition/MapperConfig/BannerProfile.cs deleted file mode 100644 index e13f8199..00000000 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Exhibition/MapperConfig/BannerProfile.cs +++ /dev/null @@ -1,24 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.BBS.Application.Contracts.Exhibition.Dtos; -using Yi.BBS.Application.Contracts.Exhibition.Dtos.Banner; -using Yi.BBS.Domain.Exhibition.Entities; - -namespace Yi.BBS.Application.Exhibition.MapperConfig -{ - public class BannerProfile: Profile - { - public BannerProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/DiscussService.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/DiscussService.cs index e7c2b809..a92e459a 100644 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/DiscussService.cs +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/DiscussService.cs @@ -7,7 +7,7 @@ using Yi.BBS.Application.Contracts.Forum.Dtos.Discuss; using Microsoft.AspNetCore.Mvc; using Yi.Framework.Ddd.Dtos; using Yi.BBS.Domain.Forum; -using AutoMapper; +using MapsterMapper; using SqlSugar; using Microsoft.AspNetCore.Routing; using Yi.BBS.Domain.Shared.Forum.ConstClasses; diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/ArticleProfile.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/ArticleProfile.cs deleted file mode 100644 index 2bde67b2..00000000 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/ArticleProfile.cs +++ /dev/null @@ -1,24 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.BBS.Application.Contracts.Forum.Dtos; -using Yi.BBS.Domain.Forum.Entities; - -namespace Yi.BBS.Application.Forum.MapperConfig -{ - public class ArticleProfile: Profile - { - public ArticleProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/CommentProfile.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/CommentProfile.cs deleted file mode 100644 index 9d581293..00000000 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/CommentProfile.cs +++ /dev/null @@ -1,23 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.BBS.Application.Contracts.Forum.Dtos; -using Yi.BBS.Domain.Forum.Entities; - -namespace Yi.BBS.Application.Forum.MapperConfig -{ - public class CommentProfile: Profile - { - public CommentProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/DiscussProfile.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/DiscussProfile.cs deleted file mode 100644 index 20bfbea4..00000000 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/DiscussProfile.cs +++ /dev/null @@ -1,24 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.BBS.Application.Contracts.Forum.Dtos; -using Yi.BBS.Application.Contracts.Forum.Dtos.Discuss; -using Yi.BBS.Domain.Forum.Entities; - -namespace Yi.BBS.Application.Forum.MapperConfig -{ - public class DiscussProfile: Profile - { - public DiscussProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/MyTypeProfile.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/MyTypeProfile.cs deleted file mode 100644 index 65d2724e..00000000 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/MyTypeProfile.cs +++ /dev/null @@ -1,23 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.BBS.Application.Contracts.Forum.Dtos; -using Yi.BBS.Domain.Forum.Entities; - -namespace Yi.BBS.Application.Forum.MapperConfig -{ - public class MyTypeProfile: Profile - { - public MyTypeProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/PlateProfile.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/PlateProfile.cs deleted file mode 100644 index 41995c1c..00000000 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/PlateProfile.cs +++ /dev/null @@ -1,24 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.BBS.Application.Contracts.Forum.Dtos; -using Yi.BBS.Application.Contracts.Forum.Dtos.Plate; -using Yi.BBS.Domain.Forum.Entities; - -namespace Yi.BBS.Application.Forum.MapperConfig -{ - public class PlateProfile: Profile - { - public PlateProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/DictionaryService.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/DictionaryService.cs index 7673319e..419a4448 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/DictionaryService.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/DictionaryService.cs @@ -23,11 +23,15 @@ namespace Yi.RBAC.Application.Dictionary private IDictionaryRepository _dictionaryRepository { get; set; } public override async Task> GetListAsync(DictionaryGetListInputVo input) { - var data = await _dictionaryRepository.SelectGetListAsync(await MapToEntityAsync(input), input); + int total = 0; + var entities = await _DbQueryable.WhereIF(input.DictType is not null, x => x.DictType == input.DictType) + .WhereIF(input.DictLabel is not null, x => x.DictLabel!.Contains(input.DictLabel!)) + .WhereIF(input.State is not null, x => x.State == input.State) + .ToPageListAsync(input.PageNum, input.PageSize, total); return new PagedResultDto { - Total = data.Total, - Items = await MapToGetListOutputDtosAsync(data.Items) + Total = total, + Items = await MapToGetListOutputDtosAsync(entities) }; } diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/DictionaryTypeService.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/DictionaryTypeService.cs index f634af22..f1d7af3d 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/DictionaryTypeService.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/DictionaryTypeService.cs @@ -5,6 +5,7 @@ using Yi.RBAC.Domain.Dictionary.Entities; using Yi.Framework.Ddd.Services; using Yi.RBAC.Domain.Dictionary.Repositories; using Yi.Framework.Ddd.Dtos; +using SqlSugar; namespace Yi.RBAC.Application.Dictionary { @@ -21,11 +22,18 @@ namespace Yi.RBAC.Application.Dictionary public async override Task> GetListAsync(DictionaryTypeGetListInputVo input) { - var data = await _dictionaryTypeRepository.SelectGetListAsync(await MapToEntityAsync(input), input); + + int total = 0; + var entities = await _DbQueryable.WhereIF(input.DictName is not null, x => x.DictName.Contains(input.DictName!)) + .WhereIF(input.DictType is not null, x => x.DictType!.Contains(input.DictType!)) + .WhereIF(input.State is not null, x => x.State == input.State) + .WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime) + .ToPageListAsync(input.PageNum, input.PageSize, total); + return new PagedResultDto { - Total = data.Total, - Items = await MapToGetListOutputDtosAsync(data.Items) + Total = total, + Items = await MapToGetListOutputDtosAsync(entities) }; } diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/MapperConfig/DictionaryProfile.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/MapperConfig/DictionaryProfile.cs deleted file mode 100644 index e1850afc..00000000 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/MapperConfig/DictionaryProfile.cs +++ /dev/null @@ -1,23 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.RBAC.Application.Contracts.Dictionary.Dtos; -using Yi.RBAC.Domain.Dictionary.Entities; - -namespace Yi.RBAC.Application.Dictionary.MapperConfig -{ - public class DictionaryProfile: Profile - { - public DictionaryProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/MapperConfig/DictionaryTypeProfile.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/MapperConfig/DictionaryTypeProfile.cs deleted file mode 100644 index 1283061b..00000000 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Dictionary/MapperConfig/DictionaryTypeProfile.cs +++ /dev/null @@ -1,23 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.RBAC.Application.Contracts.Dictionary.Dtos; -using Yi.RBAC.Domain.Dictionary.Entities; - -namespace Yi.RBAC.Application.Dictionary.MapperConfig -{ - public class DictionaryTypeProfile: Profile - { - public DictionaryTypeProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/DeptProfile.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/DeptProfile.cs deleted file mode 100644 index 15419480..00000000 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/DeptProfile.cs +++ /dev/null @@ -1,23 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.RBAC.Application.Contracts.Identity.Dtos; -using Yi.RBAC.Domain.Identity.Entities; - -namespace Yi.RBAC.Application.Identity.MapperConfig -{ - public class DeptProfile: Profile - { - public DeptProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/MenuProfile.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/MenuProfile.cs deleted file mode 100644 index 2ead3d64..00000000 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/MenuProfile.cs +++ /dev/null @@ -1,23 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.RBAC.Application.Contracts.Identity.Dtos; -using Yi.RBAC.Domain.Identity.Entities; - -namespace Yi.RBAC.Application.Identity.MapperConfig -{ - public class MenuProfile: Profile - { - public MenuProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/PostProfile.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/PostProfile.cs deleted file mode 100644 index e1bd6225..00000000 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/PostProfile.cs +++ /dev/null @@ -1,23 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.RBAC.Application.Contracts.Identity.Dtos; -using Yi.RBAC.Domain.Identity.Entities; - -namespace Yi.RBAC.Application.Identity.MapperConfig -{ - public class PostProfile: Profile - { - public PostProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/RoleProfile.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/RoleProfile.cs deleted file mode 100644 index 2d87da5f..00000000 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/RoleProfile.cs +++ /dev/null @@ -1,23 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.RBAC.Application.Contracts.Identity.Dtos; -using Yi.RBAC.Domain.Identity.Entities; - -namespace Yi.RBAC.Application.Identity.MapperConfig -{ - public class RoleProfile: Profile - { - public RoleProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/UserProfile.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/UserProfile.cs deleted file mode 100644 index 82a58059..00000000 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/MapperConfig/UserProfile.cs +++ /dev/null @@ -1,23 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.RBAC.Application.Contracts.Identity.Dtos; -using Yi.RBAC.Domain.Identity.Entities; - -namespace Yi.RBAC.Application.Identity.MapperConfig -{ - public class UserProfile: Profile - { - public UserProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/UserService.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/UserService.cs index f3c1edc2..85e99807 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/UserService.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/UserService.cs @@ -35,10 +35,17 @@ namespace Yi.RBAC.Application.Identity public override async Task> GetListAsync(UserGetListInputVo input) { var entity = await MapToEntityAsync(input); - var entities = await _userRepository.SelctGetListAsync(entity, input); + + int total = 0; + + var entities = await _DbQueryable.WhereIF(!string.IsNullOrEmpty(input.UserName), x => x.UserName.Contains(input.UserName!)). + WhereIF(input.Phone is not null, x => x.Phone.ToString()!.Contains(input.Phone.ToString()!)). + WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name!.Contains(input.Name!)). + WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime).ToPageListAsync(input.PageNum, input.PageSize, total); + var result = new PagedResultDto(); result.Items = await MapToGetListOutputDtosAsync(entities); - result.Total = await _repository.CountAsync(_ => true); + result.Total = total; return result; } diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/DomainSwaggerDoc.xml b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/DomainSwaggerDoc.xml index 69ac6079..43218a62 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/DomainSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/DomainSwaggerDoc.xml @@ -669,14 +669,6 @@ - - - 动态分页选择 - - - - - 给用户设置角色 diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Identity/Repositories/IUserRepository.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Identity/Repositories/IUserRepository.cs index b97c63f8..c6e66764 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Identity/Repositories/IUserRepository.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Identity/Repositories/IUserRepository.cs @@ -21,12 +21,5 @@ namespace Yi.RBAC.Domain.Identity.Repositories /// Task GetUserAllInfoAsync(long userId); - /// - /// 动态分页选择 - /// - /// - /// - /// - Task> SelctGetListAsync(UserEntity input, IPagedAllResultRequestDto pageInput); } } diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Sqlsugar/Repositories/DictionaryRepository.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Sqlsugar/Repositories/DictionaryRepository.cs deleted file mode 100644 index bc8268e6..00000000 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Sqlsugar/Repositories/DictionaryRepository.cs +++ /dev/null @@ -1,36 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.Framework.Core.Sqlsugar.Repositories; -using Yi.Framework.Ddd.Dtos; -using Yi.Framework.Ddd.Dtos.Abstract; -using Yi.RBAC.Domain.Dictionary.Entities; -using Yi.RBAC.Domain.Dictionary.Repositories; -using Yi.RBAC.Domain.Identity.Entities; -using Yi.RBAC.Domain.Identity.Repositories; - -namespace Yi.RBAC.Sqlsugar.Repositories -{ - [AppService] - public class DictionaryRepository : SqlsugarRepository, IDictionaryRepository - { - public DictionaryRepository(ISqlSugarClient context) : base(context) - { - } - - public async Task> SelectGetListAsync(DictionaryEntity input, IPagedAndSortedResultRequestDto pageInput) - { - RefAsync total = 0; - var entities = await _DbQueryable.WhereIF(input.DictType is not null, x => x.DictType == input.DictType) - .WhereIF(input.DictLabel is not null, x => x.DictLabel!.Contains(input.DictLabel!)) - .WhereIF(input.State is not null,x => x.State == input.State) - .ToPageListAsync(pageInput.PageNum, pageInput.PageSize, total); - - - return new PagedDto(total, entities); - } - } -} diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Sqlsugar/Repositories/DictionaryTypeRepository.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Sqlsugar/Repositories/DictionaryTypeRepository.cs deleted file mode 100644 index eeee90eb..00000000 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Sqlsugar/Repositories/DictionaryTypeRepository.cs +++ /dev/null @@ -1,35 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.Framework.Core.Sqlsugar.Repositories; -using Yi.Framework.Ddd.Dtos; -using Yi.Framework.Ddd.Dtos.Abstract; -using Yi.RBAC.Domain.Dictionary.Entities; -using Yi.RBAC.Domain.Dictionary.Repositories; - -namespace Yi.RBAC.Sqlsugar.Repositories -{ - [AppService] - public class DictionaryTypeRepository : SqlsugarRepository, IDictionaryTypeRepository - { - public DictionaryTypeRepository(ISqlSugarClient context) : base(context) - { - } - - public async Task> SelectGetListAsync(DictionaryTypeEntity input, IPagedAllResultRequestDto pageInput) - { - RefAsync total = 0; - var entities = await _DbQueryable.WhereIF(input.DictName is not null, x => x.DictName.Contains(input.DictName!)) - .WhereIF(input.DictType is not null, x => x.DictType!.Contains(input.DictType!)) - .WhereIF(input.State is not null, x => x.State == input.State) - .WhereIF(pageInput.StartTime is not null && pageInput.EndTime is not null ,x=>x.CreationTime>=pageInput.StartTime && x.CreationTime<=pageInput.EndTime) - .ToPageListAsync(pageInput.PageNum, pageInput.PageSize, total); - - - return new PagedDto(total, entities); - } - } -} diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Sqlsugar/Repositories/UserRepository.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Sqlsugar/Repositories/UserRepository.cs index f202506a..efda7689 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Sqlsugar/Repositories/UserRepository.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Sqlsugar/Repositories/UserRepository.cs @@ -24,15 +24,6 @@ namespace Yi.RBAC.Sqlsugar.Repositories } - public async Task> SelctGetListAsync(UserEntity input, IPagedAllResultRequestDto pageInput) - { - var entities = await _DbQueryable.WhereIF(!string.IsNullOrEmpty(input.UserName), x => x.UserName.Contains(input.UserName!)). - WhereIF(input.Phone is not null, x => x.Phone.ToString()! .Contains(input.Phone.ToString()!)). - WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name!.Contains(input.Name!)). - WhereIF(pageInput.StartTime is not null && pageInput.EndTime is not null, x => x.CreationTime >= pageInput.StartTime && x.CreationTime <= pageInput.EndTime).ToPageListAsync(pageInput.PageNum, pageInput.PageSize); - - return entities; - } /// /// 获取用户id的全部信息 diff --git a/Yi.Framework.Net6/src/project/template/Yi.Template.Application/School/MapperConfig/StudentProfile.cs b/Yi.Framework.Net6/src/project/template/Yi.Template.Application/School/MapperConfig/StudentProfile.cs deleted file mode 100644 index bcea70dd..00000000 --- a/Yi.Framework.Net6/src/project/template/Yi.Template.Application/School/MapperConfig/StudentProfile.cs +++ /dev/null @@ -1,23 +0,0 @@ -using AutoMapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.Template.Application.Contracts.School.Dtos; -using Yi.Template.Domain.School.Entities; - -namespace Yi.Template.Application.School.MapperConfig -{ - public class StudentProfile: Profile - { - public StudentProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - } -}