diff --git a/Aurora.Common/Aurora.Common.csproj b/Aurora.Common/Aurora.Common.csproj
new file mode 100644
index 0000000000000000000000000000000000000000..bb51f41f9f2aa00482e8c65b319a2bd61d0796b3
--- /dev/null
+++ b/Aurora.Common/Aurora.Common.csproj
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ net5.0
+
+
+
diff --git a/Aurora.Common/ConstStrings.cs b/Aurora.Common/ConstStrings.cs
new file mode 100644
index 0000000000000000000000000000000000000000..54efda0c7009f1bb741e8fc6b68cb06016bd9a64
--- /dev/null
+++ b/Aurora.Common/ConstStrings.cs
@@ -0,0 +1,8 @@
+
+namespace Aurora.Common
+{
+ public class ConstString
+ {
+ public const string CurrentTenantCode = "TenantCode";
+ }
+}
\ No newline at end of file
diff --git a/Aurora.Common/CurrentProvider.cs b/Aurora.Common/CurrentProvider.cs
new file mode 100644
index 0000000000000000000000000000000000000000..9f7a7a11e2e5bc4fa83d39b20a686c02735ba548
--- /dev/null
+++ b/Aurora.Common/CurrentProvider.cs
@@ -0,0 +1,25 @@
+
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Claims;
+using Aurora.Infrastructure.User;
+
+namespace Aurora.Common
+{
+
+
+
+ public class CurrentProvider
+ {
+ ///
+ /// 租户code
+ ///
+ public string TenantCode { get; set; }
+
+ public ICurrentUser CurrentUser { get; set; }
+
+ public T RequestEntity { get; set; }
+ }
+}
diff --git a/Aurora.Common/Entities/EntityBase.cs b/Aurora.Common/Entities/EntityBase.cs
new file mode 100644
index 0000000000000000000000000000000000000000..865aee34871196f70914694f5bce1c76862cf1dd
--- /dev/null
+++ b/Aurora.Common/Entities/EntityBase.cs
@@ -0,0 +1,13 @@
+using System;
+
+namespace Aurora.Common.Entities
+{
+ public class EntityBase
+ {
+ public int Id { get; set; }
+ public DateTimeOffset CreateTime { get; set; }
+ public string CreateUserName { get; set; }
+ public DateTimeOffset ModifyTime { get; set; }
+ public string ModifyUserName { get; set; }
+ }
+}
diff --git a/Aurora.Common/Entities/TenantEntityBase.cs b/Aurora.Common/Entities/TenantEntityBase.cs
new file mode 100644
index 0000000000000000000000000000000000000000..5a72a2fe32fbf26d32500b7068b6d688907bfca7
--- /dev/null
+++ b/Aurora.Common/Entities/TenantEntityBase.cs
@@ -0,0 +1,10 @@
+using System;
+
+namespace Aurora.Common.Entities
+{
+ public class TenantEntityBase : EntityBase
+ {
+ public string TenantCode { get; set; }
+
+ }
+}
diff --git a/Aurora.Common/Permission/FunctionPermission.cs b/Aurora.Common/Permission/FunctionPermission.cs
new file mode 100644
index 0000000000000000000000000000000000000000..c92568572f9fd01daa406c9760e3bbfc2442a9eb
--- /dev/null
+++ b/Aurora.Common/Permission/FunctionPermission.cs
@@ -0,0 +1,15 @@
+
+
+using System.Linq;
+using System.Security.Claims;
+using Aurora.Infrastructure.Permission;
+
+namespace Aurora.Common.Permission
+{
+
+ public class FunctionPermission : IFunctionPermission
+ {
+ public string FunctionCode { get; set; }
+ public string PermissionCode { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Aurora.Common/Tenant/CurrentTenant.cs b/Aurora.Common/Tenant/CurrentTenant.cs
new file mode 100644
index 0000000000000000000000000000000000000000..e46f5aa297123f43922b7f3f6a67ad38a28bcd4e
--- /dev/null
+++ b/Aurora.Common/Tenant/CurrentTenant.cs
@@ -0,0 +1,13 @@
+
+
+using System.Linq;
+using System.Security.Claims;
+using Aurora.Infrastructure.Tenant;
+
+namespace Aurora.Common.Tenant
+{
+ public class CurrentTenant : ICurrentTenant
+ {
+ public string TenantCode { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Aurora.Common/Tenant/CurrentTenantProvider.cs b/Aurora.Common/Tenant/CurrentTenantProvider.cs
new file mode 100644
index 0000000000000000000000000000000000000000..2dab93ec2591cb4eca443700be668b9918777433
--- /dev/null
+++ b/Aurora.Common/Tenant/CurrentTenantProvider.cs
@@ -0,0 +1,45 @@
+using IdentityModel;
+using Microsoft.AspNetCore.Http;
+using System.Linq;
+using System.Security.Claims;
+using Aurora.Infrastructure.Tenant;
+
+namespace Aurora.Common.Tenant
+{
+
+ public class CurrentTenantProvider : ICurrentTenantProvider
+ {
+ private CurrentTenant currentTenant { get; set; }
+
+ IHttpContextAccessor httpContextAccessor;
+ public CurrentTenantProvider(IHttpContextAccessor _httpContextAccessor)
+ {
+ httpContextAccessor = _httpContextAccessor;
+ }
+
+ public ICurrentTenant GetCurrentTenant()
+ {
+ CurrentTenant _currentTenant = new CurrentTenant();
+ if (httpContextAccessor.HttpContext == null) //cap
+ {
+ //todo
+ _currentTenant = currentTenant;
+ }
+ else if (httpContextAccessor.HttpContext.User != null &&
+ httpContextAccessor.HttpContext.User.Identity.IsAuthenticated) //external
+ {
+ ClaimsPrincipal claimsPrincipal = httpContextAccessor.HttpContext.User;
+ var subject = claimsPrincipal.Claims.FirstOrDefault(w => w.Type == JwtClaimTypes.Role);
+ _currentTenant.TenantCode = subject.Value;
+ }
+ else //internal
+ {
+ _currentTenant.TenantCode = httpContextAccessor.HttpContext.Request.Headers[ConstString.CurrentTenantCode].FirstOrDefault();
+ }
+ return _currentTenant;
+ }
+
+ }
+
+
+}
diff --git a/Aurora.Common/User/CurrentUser.cs b/Aurora.Common/User/CurrentUser.cs
new file mode 100644
index 0000000000000000000000000000000000000000..e17067e3c0b9251c9b84f9dd20b57890636d8b53
--- /dev/null
+++ b/Aurora.Common/User/CurrentUser.cs
@@ -0,0 +1,41 @@
+
+
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Configuration;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Claims;
+using Aurora.Infrastructure.User;
+using Aurora.Infrastructure.Permission;
+using Aurora.Common.Permission;
+
+namespace Aurora.Common.User
+{
+
+ public class CurrentUser : ICurrentUser
+ {
+ ///
+ /// 用户登录用户Code
+ ///
+ public string UserCode { get; set; }
+ ///
+ /// 用户名称
+ ///
+ public string UserName { get; set; }
+ ///
+ /// 用户名 编码
+ ///
+ // public string NameAndCode { get { return $"{CurrentUserName} {CurrentUserCode}"; } }
+ ///
+ /// 角色Code
+ ///
+ public string RoleCode { get; set; }
+ ///
+ /// 角色Name
+ ///
+ public string RoleName { get; set; }
+
+ public List RolePermission { get; set; }
+ }
+}
diff --git a/Aurora.Common/User/CurrentUserProvider.cs b/Aurora.Common/User/CurrentUserProvider.cs
new file mode 100644
index 0000000000000000000000000000000000000000..5677f138548605ef1ef718983849478269291bc0
--- /dev/null
+++ b/Aurora.Common/User/CurrentUserProvider.cs
@@ -0,0 +1,56 @@
+
+
+using IdentityModel;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Configuration;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Claims;
+using Aurora.Infrastructure.User;
+
+namespace Aurora.Common.User
+{
+ public class CurrentUserProvider : ICurrentUserProvider
+ {
+ IHttpContextAccessor httpContextAccessor;
+ IConfiguration _configuration;
+ public CurrentUserProvider(IHttpContextAccessor _httpContextAccessor, IConfiguration configuration)
+ {
+ httpContextAccessor = _httpContextAccessor;
+ _configuration = configuration;
+ }
+
+ public ICurrentUser GetCurrentUser()
+ {
+ ICurrentUser currentUser = new CurrentUser();
+ if (httpContextAccessor.HttpContext == null) //cap
+ {
+ currentUser.UserCode = "cap";
+ currentUser.UserName = "cap";
+ }
+ else if (httpContextAccessor.HttpContext.User != null &&
+ httpContextAccessor.HttpContext.User.Identity.IsAuthenticated) //external
+ {
+ ClaimsPrincipal claimsPrincipal = httpContextAccessor.HttpContext.User;
+ var subject = claimsPrincipal.Claims.FirstOrDefault(w => w.Type == JwtClaimTypes.Subject);
+
+ var subjectRole = claimsPrincipal.Claims.FirstOrDefault(w => w.Type == JwtClaimTypes.Role);
+ currentUser = GetCurrentUserFromRedis(subject.Value, subjectRole.Value);
+ }
+ else //internal
+ {
+ currentUser.UserCode = "internal";
+ currentUser.UserName = "internal";
+ }
+ return currentUser;
+ }
+
+ private ICurrentUser GetCurrentUserFromRedis(string usercode, string tenantCode)
+ {
+ // var redisUserInfo = new CacheRedis(RedisDBType.User, _configuration).GetJSON($"{tenantCode}:{usercode}");
+ return new CurrentUser();
+ // return redisUserInfo;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Aurora.Infrastructure/Aurora.Infrastructure.csproj b/Aurora.Infrastructure/Aurora.Infrastructure.csproj
new file mode 100644
index 0000000000000000000000000000000000000000..563e6f937abf55bafef7b92c3a5ca67ac86a9434
--- /dev/null
+++ b/Aurora.Infrastructure/Aurora.Infrastructure.csproj
@@ -0,0 +1,7 @@
+
+
+
+ net5.0
+
+
+
diff --git a/Aurora.Infrastructure/Permission/IFunctionPermission.cs b/Aurora.Infrastructure/Permission/IFunctionPermission.cs
new file mode 100644
index 0000000000000000000000000000000000000000..98725c364429fafe0c01b4e3f60d84a6d2f26ae3
--- /dev/null
+++ b/Aurora.Infrastructure/Permission/IFunctionPermission.cs
@@ -0,0 +1,13 @@
+
+
+using System.Linq;
+
+namespace Aurora.Infrastructure.Permission
+{
+
+ public interface IFunctionPermission
+ {
+ string FunctionCode { get; set; }
+ string PermissionCode { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Aurora.Infrastructure/Response/ErrorCodes.cs b/Aurora.Infrastructure/Response/ErrorCodes.cs
new file mode 100644
index 0000000000000000000000000000000000000000..9f39a66a592b4c226f0836d1918594eade9941f7
--- /dev/null
+++ b/Aurora.Infrastructure/Response/ErrorCodes.cs
@@ -0,0 +1,15 @@
+
+
+
+using System;
+
+namespace Aurora.Infrastructure.Response
+{
+ public enum ErrorCodes
+ {
+ Success = 0,
+ Notfound = 400,
+ Error = 500,
+ NoPermession = 600,
+ }
+}
diff --git a/Aurora.Infrastructure/Response/ResponseModel.cs b/Aurora.Infrastructure/Response/ResponseModel.cs
new file mode 100644
index 0000000000000000000000000000000000000000..7c226aafa05790f4547025d6c97f3f486eda56bd
--- /dev/null
+++ b/Aurora.Infrastructure/Response/ResponseModel.cs
@@ -0,0 +1,20 @@
+
+
+
+using System;
+
+namespace Aurora.Infrastructure.Response
+{
+ public class ResponseModel
+ {
+ ErrorCodes ErrorCode { get; set; }
+
+ T Data { get; set; }
+
+ public ResponseModel(T data)
+ {
+ Data = data;
+ ErrorCode = ErrorCodes.Success;
+ }
+ }
+}
diff --git a/Aurora.Infrastructure/Tenant/ICurrentTenant.cs b/Aurora.Infrastructure/Tenant/ICurrentTenant.cs
new file mode 100644
index 0000000000000000000000000000000000000000..ed4c883377382960a4e79763b255b0c3c9500277
--- /dev/null
+++ b/Aurora.Infrastructure/Tenant/ICurrentTenant.cs
@@ -0,0 +1,10 @@
+using System;
+
+namespace Aurora.Infrastructure.Tenant
+{
+ public interface ICurrentTenant
+ {
+ string TenantCode { get; set; }
+
+ }
+}
diff --git a/Aurora.Infrastructure/Tenant/ICurrentTenantProvider.cs b/Aurora.Infrastructure/Tenant/ICurrentTenantProvider.cs
new file mode 100644
index 0000000000000000000000000000000000000000..dc8f8b4fc3ac73675b8ae28f07cf808cfe411427
--- /dev/null
+++ b/Aurora.Infrastructure/Tenant/ICurrentTenantProvider.cs
@@ -0,0 +1,10 @@
+using System;
+
+namespace Aurora.Infrastructure.Tenant
+{
+ public interface ICurrentTenantProvider
+ {
+ ICurrentTenant GetCurrentTenant();
+
+ }
+}
diff --git a/Aurora.Infrastructure/User/ICurrentUser.cs b/Aurora.Infrastructure/User/ICurrentUser.cs
new file mode 100644
index 0000000000000000000000000000000000000000..d1015270a7d445df838abae609870c07a71accaa
--- /dev/null
+++ b/Aurora.Infrastructure/User/ICurrentUser.cs
@@ -0,0 +1,37 @@
+
+using System;
+using Aurora.Infrastructure.Permission;
+using System.Collections.Generic;
+
+namespace Aurora.Infrastructure.User
+{
+ public interface ICurrentUser
+ {
+ ///
+ /// 用户登录用户Code
+ ///
+ string UserCode { get; set; }
+ ///
+ /// 用户名称
+ ///
+ string UserName { get; set; }
+ ///
+ /// 用户名 编码
+ ///
+ // string NameAndCode { get { return $"{CurrentUserName} {CurrentUserCode}"; } }
+ ///
+ /// 角色Code
+ ///
+ string RoleCode { get; set; }
+ ///
+ /// 角色Name
+ ///
+ string RoleName { get; set; }
+
+ List RolePermission { get; set; }
+
+
+ }
+
+
+}
diff --git a/Aurora.Infrastructure/User/ICurrentUserProvider.cs b/Aurora.Infrastructure/User/ICurrentUserProvider.cs
new file mode 100644
index 0000000000000000000000000000000000000000..8bc7ad994c6b61e904ebc155b5f81296a4ed6983
--- /dev/null
+++ b/Aurora.Infrastructure/User/ICurrentUserProvider.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace Aurora.Infrastructure.User
+{
+ public interface ICurrentUserProvider
+ {
+ ICurrentUser GetCurrentUser();
+ }
+}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Aurora.Core.Api.csproj b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Aurora.Core.Api.csproj
index 166ad9b5b10d499dcf575f7d21ff2d821a14c0a4..f0dab8cc5185e997c340e18ea768280dad00c89b 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Aurora.Core.Api.csproj
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Aurora.Core.Api.csproj
@@ -5,11 +5,17 @@
+
+
+
+
+
+
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Controllers/CategoryController.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Controllers/CategoryController.cs
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e5e96b8012116be9d9284fddd49d110d3aaf4100 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Controllers/CategoryController.cs
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Controllers/CategoryController.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Aurora.Core.IService;
+using Aurora.Core.IService.Dto;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+
+namespace Aurora.Core.Api.Controllers
+{
+ [ApiController]
+ [Route("[controller]/[action]")]
+ public class CategoryController : ControllerBase
+ {
+ private readonly ILogger _logger;
+ private readonly ICategoryService _categoryService;
+
+ public CategoryController(ILogger logger,
+ ICategoryService categoryService)
+ {
+ _logger = logger;
+ _categoryService = categoryService;
+ }
+
+ [HttpGet]
+ ///
+ /// get cateories list
+ ///
+ ///
+ public async Task GetList()
+ {
+ var res = await _categoryService.GetList();
+ return Ok();
+ }
+
+ [HttpGet]
+ ///
+ /// get cateory by id
+ ///
+ ///
+ public async Task GetById(int id)
+ {
+ var res = await _categoryService.GetById(id);
+ return Ok();
+ }
+
+ [HttpPost]
+ ///
+ /// get cateory by id
+ ///
+ ///
+ public async Task Add(CategoryDto model)
+ {
+ var res = await _categoryService.Add(model);
+ return Ok();
+ }
+ }
+}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Controllers/WeatherForecastController.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Controllers/WeatherForecastController.cs
deleted file mode 100644
index 77726b8ea1087b4edfc67eb9b5161be8ce56c43f..0000000000000000000000000000000000000000
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Controllers/WeatherForecastController.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Logging;
-
-namespace Aurora.Core.Api.Controllers
-{
- [ApiController]
- [Route("[controller]")]
- public class WeatherForecastController : ControllerBase
- {
- private static readonly string[] Summaries = new[]
- {
- "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
- };
-
- private readonly ILogger _logger;
-
- public WeatherForecastController(ILogger logger)
- {
- _logger = logger;
- }
-
- [HttpGet]
- public IEnumerable Get()
- {
- var rng = new Random();
- return Enumerable.Range(1, 5).Select(index => new WeatherForecast
- {
- Date = DateTime.Now.AddDays(index),
- TemperatureC = rng.Next(-20, 55),
- Summary = Summaries[rng.Next(Summaries.Length)]
- })
- .ToArray();
- }
- }
-}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/CoreApiModule.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/CoreApiModule.cs
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ba009e0e62e1b1f09bd7d491f085b1fcb170094f 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/CoreApiModule.cs
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/CoreApiModule.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Reflection;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Aurora.Core.EntityFramework;
+using Microsoft.EntityFrameworkCore;
+using Aurora.Core.Service;
+using Aurora.Core.IService;
+using Aurora.Infrastructure.Tenant;
+using Aurora.Infrastructure.User;
+using Aurora.Common.User;
+using Aurora.Common.Tenant;
+using Microsoft.AspNetCore.Http;
+
+namespace Aurora.Core.Api
+{
+ public static class CoreApiModule
+ {
+ public static IServiceCollection AddCoreApiModule(this IServiceCollection services, IConfiguration configuration)
+ {
+ if (services == null)
+ {
+ throw new ArgumentNullException("services");
+ }
+
+ services.AddAutoMapper(Assembly.Load("Aurora.Core.Service"));
+
+ //注入请求上下文
+ services.AddSingleton();
+ services.AddScoped();
+ services.AddScoped();
+
+ services.AddDbContext(option =>
+ option.UseMySQL(configuration["ConnectionStrings:MySql"]));
+ services.AddDbContext(option =>
+ option.UseMySQL(configuration["ReadOnlyConnectionStrings:MySql"]));
+
+ services.AddTransient();
+
+ // var RFCOptions = services.BuildServiceProvider().GetService>();
+
+ // //注入RFC链接
+ // services.AddSingleton(p =>
+ // new RfcConnection(builder => builder
+ // .UseConnectionHost(RFCOptions.Value.HostName)
+ // .UseLogonUserName(RFCOptions.Value.UserName)
+ // .UseLogonPassword(RFCOptions.Value.Password)
+ // .UseLogonClient(RFCOptions.Value.Client)
+ // .UseLogonLanguage(RFCOptions.Value.LogonLanguage)
+ // .UseSystemNumber(RFCOptions.Value.SystemNumber)
+ // .UseSapRouter(RFCOptions.Value.SapRouter))
+ // );
+
+ // services.AddSingleton();
+ // services.AddSingleton();
+ // services.AddSingleton();
+ // services.AddSingleton();
+ // services.AddSingleton();
+ // services.AddSingleton();
+ return services;
+ }
+
+ }
+}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/MoudelInit.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/MoudelInit.cs
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Properties/launchSettings.json b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Properties/launchSettings.json
index acfc4535e079b5471454eeb191fa2031bc0eb9e5..823c035d20c44b24250d0e1fdba1f57c6aa37012 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Properties/launchSettings.json
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Properties/launchSettings.json
@@ -22,7 +22,7 @@
"dotnetRunMessages": "true",
"launchBrowser": true,
"launchUrl": "swagger",
- "applicationUrl": "https://localhost:5001;http://localhost:5000",
+ "applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Startup.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Startup.cs
index 774f9044cea9f18df8e392b48cf959ad6505afa7..0c9d24d9b1402a8492e637c2f49bc52479190047 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Startup.cs
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/Startup.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@@ -11,6 +12,9 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.OpenApi.Models;
+using System.IO;
+using Aurora.Core.EntityFramework;
+using Microsoft.EntityFrameworkCore;
namespace Aurora.Core.Api
{
@@ -32,6 +36,9 @@ namespace Aurora.Core.Api
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Aurora.Core.Api", Version = "v1" });
});
+
+ services.AddCoreApiModule(Configuration);
+
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/WeatherForecast.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/WeatherForecast.cs
deleted file mode 100644
index 5a2c8349779b23fa9b68080cea8f04189de4f45a..0000000000000000000000000000000000000000
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/WeatherForecast.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-namespace Aurora.Core.Api
-{
- public class WeatherForecast
- {
- public DateTime Date { get; set; }
-
- public int TemperatureC { get; set; }
-
- public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
-
- public string Summary { get; set; }
- }
-}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/appsettings.Development.json b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/appsettings.Development.json
index 8983e0fc1c5e2795ccfde0c771c6d66c88ef4a42..6778bd7991cbe1139f47aeebbb864466faa79f23 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/appsettings.Development.json
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/appsettings.Development.json
@@ -5,5 +5,19 @@
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
+ },
+ "ConnectionStrings": {
+ "Enable": "MySql",
+ "MySql": "Server=127.0.0.1; Port=3380;User Id=root;Password=123456;Database=exam_practice;Allow User Variables=True",
+ "SqlServer": "Data Source=192.168.1.139;Initial Catalog=PTS2;User ID=sa;Password=;Encrypt=False;TrustServerCertificate=False;Pooling=true;max Pool Size=50;min Pool Size=1;MultipleActiveResultSets=True",
+ "PostgreSql": "Server=localhost;Database=Simon_blog;User ID=xxxxxx;Password=666",
+ "Sqlite": "Data Source=D:/xxx.db;"
+ },
+ "ReadOnlyConnectionStrings": {
+ "Enable": "MySql",
+ "MySql": "Server=127.0.0.1; Port=3381;User Id=root;Password=123456;Database=exam_practice;Allow User Variables=True",
+ "SqlServer": "Data Source=192.168.1.139;Initial Catalog=PTS2;User ID=sa;Password=;Encrypt=False;TrustServerCertificate=False;Pooling=true;max Pool Size=50;min Pool Size=1;MultipleActiveResultSets=True",
+ "PostgreSql": "Server=localhost;Database=Simon_blog;User ID=xxxxxx;Password=666",
+ "Sqlite": "Data Source=D:/xxx.db;"
}
-}
+}
\ No newline at end of file
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/appsettings.json b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/appsettings.json
index d9d9a9bff6fd6f3ee7ea00de958f135a4a28c6e6..fd3ce2b55ef6cd8513e844458fde74c94009d3bb 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/appsettings.json
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Api/appsettings.json
@@ -6,5 +6,12 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
- "AllowedHosts": "*"
-}
+ "AllowedHosts": "*",
+ "ConnectionStrings": {
+ "Enable": "MySql",
+ "MySql": "Server=xxxxxx; Port=3306;User Id=root;Password=xxxxx;Database=xxx;Allow User Variables=True",
+ "SqlServer": "Data Source=192.168.1.139;Initial Catalog=PTS2;User ID=sa;Password=;Encrypt=False;TrustServerCertificate=False;Pooling=true;max Pool Size=50;min Pool Size=1;MultipleActiveResultSets=True",
+ "PostgreSql": "Server=localhost;Database=Simon_blog;User ID=xxxxxx;Password=666",
+ "Sqlite": "Data Source=D:/xxx.db;"
+ }
+}
\ No newline at end of file
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Aurora.Core.Domain.csproj b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Aurora.Core.Domain.csproj
index f208d303c9811fa05807ef8f72685b8ebb536a37..5e2bb39963bf53d363b0a503f8afd2c82024f505 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Aurora.Core.Domain.csproj
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Aurora.Core.Domain.csproj
@@ -1,5 +1,13 @@
+
+
+
+
+
+
+
+
net5.0
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/AutomapperProfiles/CategoryProfile b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/AutomapperProfiles/CategoryProfile
deleted file mode 100644
index 703c40889b33d0592b079449783299911d38d82c..0000000000000000000000000000000000000000
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/AutomapperProfiles/CategoryProfile
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using Aurora.Core.Domain.Entities;
-using Aurora.Core.Domain.Response;
-
-namespace Aurora.Core.Domain.xxx
-{
- public class CategoryProfile : Profile
- {
- protected override void Configure()
- {
- CreateMap();
- }
- }
-}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/AutomapperProfiles/CategoryProfile.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/AutomapperProfiles/CategoryProfile.cs
deleted file mode 100644
index 703c40889b33d0592b079449783299911d38d82c..0000000000000000000000000000000000000000
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/AutomapperProfiles/CategoryProfile.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using Aurora.Core.Domain.Entities;
-using Aurora.Core.Domain.Response;
-
-namespace Aurora.Core.Domain.xxx
-{
- public class CategoryProfile : Profile
- {
- protected override void Configure()
- {
- CreateMap();
- }
- }
-}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/AutomapperProfiles/xxx.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/AutomapperProfiles/xxx.cs
deleted file mode 100644
index 2caba2979b364f7513ccc2c3204f667535c0d52f..0000000000000000000000000000000000000000
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/AutomapperProfiles/xxx.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using Aurora.Core.Domain.Entities;
-using Aurora.Core.Domain.Response;
-
-namespace Aurora.Core.Domain.AutomapperProfiles
-{
- public class CategoryProfile : Profile
- {
- protected override void Configure()
- {
- CreateMap();
- }
- }
-}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Class1.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Class1.cs
deleted file mode 100644
index 1f4176e9ea3facd98c099052ec88b5f51a5c5591..0000000000000000000000000000000000000000
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Class1.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using System;
-
-namespace Aurora.Core.Domain
-{
- public class Class1
- {
- }
-}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Entities/Category.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Entities/Category.cs
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6c1253081dec2acf2960d655d3ac9d3320aafdbe 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Entities/Category.cs
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Entities/Category.cs
@@ -0,0 +1,11 @@
+using System;
+using Aurora.Common.Entities;
+
+namespace Aurora.Core.Domain.Entities
+{
+ public class Category : TenantEntityBase
+ {
+ public string CategoryName { get; set; }
+ public string Remark { get; set; }
+ }
+}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Response/CategoryDto.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Response/CategoryDto.cs
deleted file mode 100644
index d0962dd31c2085769679a493fb122c189467d9d4..0000000000000000000000000000000000000000
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/Response/CategoryDto.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using System;
-
-namespace Aurora.Core.Domain.Response
-{
- public class CategoryDto
- {
- }
-}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/xxx/xxx.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/xxx/xxx.cs
deleted file mode 100644
index 41ec76079d6fa3b39106b04a221e5c03cf99988c..0000000000000000000000000000000000000000
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Domain/xxx/xxx.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using System;
-
-namespace Aurora.Core.Domain.xxx
-{
- public class xxx
- {
- }
-}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/ApplicationDbContext copy.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/ApplicationDbContext.cs
similarity index 51%
rename from Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/ApplicationDbContext copy.cs
rename to Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/ApplicationDbContext.cs
index 009d0487060dd34c5d11654b9324424d99cfa2da..b1371d81ee5b390aaa201e25cf9f571656e4ef46 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/ApplicationDbContext copy.cs
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/ApplicationDbContext.cs
@@ -16,49 +16,12 @@ using Microsoft.EntityFrameworkCore;
namespace Aurora.Core.EntityFramework
{
- public class ApplicationDbContext : DbContext
+ public class ApplicationDbContext : ApplicationReadonlyDbContext
{
- public static string ConnectionString { get; set; }
- private readonly ICurrentUser currentUser;
- private readonly ICurrentTenant currentTenant;
-
- public ApplicationDbContext(DbContextOptions options,
+ public ApplicationDbContext(DbContextOptions options,
ICurrentUserProvider currentUserProvider,
- ICurrentTenantProvider currentTenantProvider) : base(options)
+ ICurrentTenantProvider currentTenantProvider) : base(options,currentUserProvider,currentTenantProvider)
{
- currentUser = currentUserProvider.GetCurrentUser();
- currentTenant = currentTenantProvider.GetCurrentTenant();
- }
-
- public DbSet Categories { get; set; }
-
- protected override void OnModelCreating(ModelBuilder builder)
- {
-
- //多租户过滤
- foreach (var type in GetBaseEntityTypes())
- {
- var method = SetGlobalQueryMethod.MakeGenericMethod(type);
- method.Invoke(this, new object[] { builder });
- }
-
- builder.Entity().HasKey(t => new { t.TenantCode });
- // builder.Entity().HasIndex(p => p.TenantCode);
-
-
- base.OnModelCreating(builder);
- }
-
- private static IList _baseEntityTypesCache;
-
- private static IList GetBaseEntityTypes()
- {
- if (_baseEntityTypesCache != null)
- return _baseEntityTypesCache.ToList();
- _baseEntityTypesCache = (from t in typeof(TenantEntityBase).GetTypeInfo().Assembly.DefinedTypes
- where t.BaseType == typeof(TenantEntityBase)
- select t.AsType()).ToList();
- return _baseEntityTypesCache;
}
public override int SaveChanges()
@@ -102,13 +65,5 @@ namespace Aurora.Core.EntityFramework
}
this.ChangeTracker.DetectChanges();
}
-
- static readonly MethodInfo SetGlobalQueryMethod = typeof(ApplicationDbContext).GetMethods(BindingFlags.Public | BindingFlags.Instance)
- .Single(t => t.IsGenericMethod && t.Name == "SetGlobalQuery");
-
- public void SetGlobalQuery(ModelBuilder builder) where T : TenantEntityBase
- {
- builder.Entity().HasQueryFilter(e => e.TenantCode == currentTenant.TenantCode);
- }
}
}
\ No newline at end of file
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/ApplicationReadonlyDbContext.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/ApplicationReadonlyDbContext.cs
index 009d0487060dd34c5d11654b9324424d99cfa2da..a97bff6dd338a5dc9a86abbe884776c8b9389cfe 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/ApplicationReadonlyDbContext.cs
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/ApplicationReadonlyDbContext.cs
@@ -16,13 +16,12 @@ using Microsoft.EntityFrameworkCore;
namespace Aurora.Core.EntityFramework
{
- public class ApplicationDbContext : DbContext
+ public class ApplicationReadonlyDbContext : DbContext
{
- public static string ConnectionString { get; set; }
- private readonly ICurrentUser currentUser;
- private readonly ICurrentTenant currentTenant;
+ protected readonly ICurrentUser currentUser;
+ protected readonly ICurrentTenant currentTenant;
- public ApplicationDbContext(DbContextOptions options,
+ public ApplicationReadonlyDbContext(DbContextOptions options,
ICurrentUserProvider currentUserProvider,
ICurrentTenantProvider currentTenantProvider) : base(options)
{
@@ -60,50 +59,7 @@ namespace Aurora.Core.EntityFramework
select t.AsType()).ToList();
return _baseEntityTypesCache;
}
-
- public override int SaveChanges()
- {
- UpdateCommonFileds();
- return base.SaveChanges();
- }
-
- public override async Task SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken))
- {
- UpdateCommonFileds();
- return await base.SaveChangesAsync(cancellationToken);
- }
-
- private void UpdateCommonFileds()
- {
- var nowTime = DateTime.Now;
-
- if (string.IsNullOrEmpty(currentUser.UserName))
- {
- var tcode = currentTenant.TenantCode;
-
- }
-
- foreach (var entry in this.ChangeTracker.Entries().Where(x => x.State == EntityState.Added || x.State == EntityState.Modified))
- {
- var entity = entry.Entity;
- switch (entry.State)
- {
- case EntityState.Added:
- if (entity.TenantCode == "")
- entity.TenantCode = currentTenant.TenantCode;
- entity.CreateTime = nowTime;
- entity.CreateUserName = currentUser.UserName;
- break;
- case EntityState.Modified:
- entity.ModifyTime = nowTime;
- entity.ModifyUserName = currentUser.UserName;
- break;
- }
- }
- this.ChangeTracker.DetectChanges();
- }
-
- static readonly MethodInfo SetGlobalQueryMethod = typeof(ApplicationDbContext).GetMethods(BindingFlags.Public | BindingFlags.Instance)
+ protected static readonly MethodInfo SetGlobalQueryMethod = typeof(ApplicationDbContext).GetMethods(BindingFlags.Public | BindingFlags.Instance)
.Single(t => t.IsGenericMethod && t.Name == "SetGlobalQuery");
public void SetGlobalQuery(ModelBuilder builder) where T : TenantEntityBase
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/Aurora.Core.EntityFramework.csproj b/Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/Aurora.Core.EntityFramework.csproj
new file mode 100644
index 0000000000000000000000000000000000000000..ef47375530494f538ca82a9c223485cbe790bceb
--- /dev/null
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.EntityFramework/Aurora.Core.EntityFramework.csproj
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ net5.0
+
+
+
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/Aurora.Core.IService.csproj b/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/Aurora.Core.IService.csproj
index a84fb1e452981bd3539071560ea4a2ea3f9e05e0..9329591098b186018c3b1594ec5b7659e14e72c9 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/Aurora.Core.IService.csproj
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/Aurora.Core.IService.csproj
@@ -1,7 +1,7 @@
-
+
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/Class1.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/Class1.cs
deleted file mode 100644
index 5ad736d3ef3409cbab54125b2e4ce2e7341688ad..0000000000000000000000000000000000000000
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/Class1.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using System;
-
-namespace Aurora.Core.IService
-{
- public class Class1
- {
- }
-}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/Dto/CategoryDto.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/Dto/CategoryDto.cs
index ca65aadeee29a510682323e3fa0a8df5266e2574..b643a93247b605a67f3515d946e7d3b2972d271d 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/Dto/CategoryDto.cs
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/Dto/CategoryDto.cs
@@ -1,9 +1,16 @@
using System;
-using Aurora.Core.Domain.Entities;
-namespace Aurora.Core.Domain.Dto
+namespace Aurora.Core.IService.Dto
{
- public class CategoryDto : Category
+ public class CategoryDto
{
+ public string CategoryName { get; set; }
+ public string Remark { get; set; }
+ public string TenantCode { get; set; }
+ public int Id { get; set; }
+ public DateTimeOffset CreateTime { get; set; }
+ public string CreateUserName { get; set; }
+ public DateTimeOffset ModifyTime { get; set; }
+ public string ModifyUserName { get; set; }
}
}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/ICategoryService.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/ICategoryService.cs
index 9c7d33985ee2ab2418a2b0ca46aecb82511a5973..0d43d091006fbcc8714a7a39636371f793f04a42 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/ICategoryService.cs
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.IService/ICategoryService.cs
@@ -1,8 +1,15 @@
using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Aurora.Core.IService.Dto;
+using Aurora.Infrastructure.Response;
namespace Aurora.Core.IService
{
- public class ICategoryService
+ public interface ICategoryService
{
+ Task> GetById(int id);
+ Task>> GetList();
+ Task> Add(CategoryDto model);
}
}
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Repositories/Aurora.Core.Repositories.csproj b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Repositories/Aurora.Core.Repositories.csproj
deleted file mode 100644
index ed820bef6bf1e04b4f1786b2e0ea16b7aa9c2f0b..0000000000000000000000000000000000000000
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Repositories/Aurora.Core.Repositories.csproj
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- net5.0
-
-
-
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Repositories/EntityFramework/ApplicationDbContext.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Repositories/EntityFramework/ApplicationDbContext.cs
deleted file mode 100644
index a958158b67ff788c79e834dd40e0a27f6cf8576d..0000000000000000000000000000000000000000
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Repositories/EntityFramework/ApplicationDbContext.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-namespace Aurora.Core.Repositories.EntityFramework
-{
-
- public class ApplicationDbContext : DbContext
- {
- protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
- {
- optionsBuilder
- .UseSqlServer(
- @"Server=(localdb)\mssqllocaldb;Database=Test",
- providerOptions => { providerOptions.EnableRetryOnFailure(); });
- }
- }
-}
\ No newline at end of file
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Service/Aurora.Core.Service.csproj b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Service/Aurora.Core.Service.csproj
index 902d73448e801ea37c4958588962827348fce3ab..73679c829fd54faf109e668ca0ee676c32d60c6d 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Service/Aurora.Core.Service.csproj
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Service/Aurora.Core.Service.csproj
@@ -2,8 +2,16 @@
+
+
+
+
+
+
+
+
net5.0
diff --git a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Service/AutomapperProfiles/CategoryProfile.cs b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Service/AutomapperProfiles/CategoryProfile.cs
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9b36ecabed109933633bab2a0194d4da73983216 100644
--- a/Aurora.Micorservices/Aurora.Core/Aurora.Core.Service/AutomapperProfiles/CategoryProfile.cs
+++ b/Aurora.Micorservices/Aurora.Core/Aurora.Core.Service/AutomapperProfiles/CategoryProfile.cs
@@ -0,0 +1,24 @@
+using System;
+using Aurora.Core.Domain.Entities;
+using Aurora.Core.IService.Dto;
+using AutoMapper;
+
+namespace Aurora.Core.Service.AutomapperProfiles
+{
+ public class CategoryProfile : Profile
+ {
+ //Source->Destination
+ // CreateMap