Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HYH.Registry
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张龙涛
HYH.Registry
Commits
12b488dc
Commit
12b488dc
authored
Aug 18, 2021
by
樊国敬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit
parent
8fedda00
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
15 deletions
+15
-15
EncryptionService.cs
...stry.Application/Services/Encryption/EncryptionService.cs
+5
-5
DbContextOptionsConfigurer.cs
...orkCore/EntityFrameworkCore/DbContextOptionsConfigurer.cs
+2
-2
PlatformDbContext.cs
...ityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs
+2
-2
RegistryDbContextFactory.cs
...eworkCore/EntityFrameworkCore/RegistryDbContextFactory.cs
+4
-4
RegistryEntityFrameworkCoreModule.cs
.../EntityFrameworkCore/RegistryEntityFrameworkCoreModule.cs
+1
-1
HYH.Registry.Application.xml
src/HYH.Registry.Web.Host/HYH.Registry.Application.xml
+1
-1
No files found.
src/HYH.Registry.Application/Services/Encryption/EncryptionService.cs
View file @
12b488dc
...
...
@@ -20,7 +20,7 @@ namespace HYH.Registry.Services.Encryption
public
class
EncryptionService
:
ApplicationService
{
private
readonly
ICurrentUser
_currentUser
;
private
readonly
RegistryDbContext
_dbContext
;
//
private readonly RegistryDbContext _dbContext;
private
readonly
DbContext
<
Tenant
>
_dbTenant
;
private
readonly
IRepository
<
Tenant
,
int
>
_repTenant
;
private
readonly
IRepository
<
MaterialPowder
,
int
>
_repMaterialPowder
;
...
...
@@ -30,7 +30,7 @@ namespace HYH.Registry.Services.Encryption
///</summary>
public
EncryptionService
(
ICurrentUser
currentUser
,
RegistryDbContext
dbContext
,
//
RegistryDbContext dbContext,
DbContext
<
Tenant
>
dbTenant
,
IRepository
<
MaterialPowder
,
int
>
repMaterialPowder
,
IRepository
<
Tenant
,
int
>
repTenant
...
...
@@ -38,7 +38,7 @@ namespace HYH.Registry.Services.Encryption
{
_repMaterialPowder
=
repMaterialPowder
;
_currentUser
=
currentUser
;
_dbContext
=
dbContext
;
//
_dbContext = dbContext;
// _dbTenant = dbTenant;
_repTenant
=
repTenant
;
...
...
@@ -54,8 +54,8 @@ namespace HYH.Registry.Services.Encryption
{
//var dfsff = _dbContext.Database.GetDbConnection().ConnectionString
string
code
=
_currentUser
.
TenantCode
;
//
var tenant = _repTenant.FirstOrDefault(q => q.Code == code);
var
ddf
=
_dbContext
.
Tenants
.
ToList
();
var
tenant
=
_repTenant
.
FirstOrDefault
(
q
=>
q
.
Code
==
code
);
var
ddf
=
_repTenant
.
GetAll
()
.
ToList
();
string
netCardMACAddress
=
ComputerInfoHelper
.
GetNetCardMACAddress
();
return
netCardMACAddress
;
}
...
...
src/HYH.Registry.EntityFrameworkCore/EntityFrameworkCore/DbContextOptionsConfigurer.cs
View file @
12b488dc
...
...
@@ -5,12 +5,12 @@ namespace HYH.Registry.EntityFrameworkCore
{
public
static
class
DbContextOptionsConfigurer
{
public
static
void
Configure
(
DbContextOptionsBuilder
<
Registry
DbContext
>
builder
,
string
connectionString
)
public
static
void
Configure
(
DbContextOptionsBuilder
<
Platform
DbContext
>
builder
,
string
connectionString
)
{
builder
.
UseMySql
(
connectionString
);
}
public
static
void
Configure
(
DbContextOptionsBuilder
<
Registry
DbContext
>
builder
,
DbConnection
connection
)
public
static
void
Configure
(
DbContextOptionsBuilder
<
Platform
DbContext
>
builder
,
DbConnection
connection
)
{
builder
.
UseMySql
(
connection
);
}
...
...
src/HYH.Registry.EntityFrameworkCore/EntityFrameworkCore/
Registry
DbContext.cs
→
src/HYH.Registry.EntityFrameworkCore/EntityFrameworkCore/
Platform
DbContext.cs
View file @
12b488dc
...
...
@@ -7,14 +7,14 @@ using Microsoft.EntityFrameworkCore;
namespace
HYH.Registry.EntityFrameworkCore
{
public
class
Registry
DbContext
:
AbpDbContext
public
class
Platform
DbContext
:
AbpDbContext
{
public
DbSet
<
Node
>
Nodes
{
get
;
set
;
}
public
DbSet
<
MaterialPowder
>
MaterialPowders
{
get
;
set
;
}
public
DbSet
<
Tenant
>
Tenants
{
get
;
set
;
}
public
RegistryDbContext
(
DbContextOptions
<
Registry
DbContext
>
options
)
public
PlatformDbContext
(
DbContextOptions
<
Platform
DbContext
>
options
)
:
base
(
options
)
{
}
...
...
src/HYH.Registry.EntityFrameworkCore/EntityFrameworkCore/RegistryDbContextFactory.cs
View file @
12b488dc
...
...
@@ -7,11 +7,11 @@ using Microsoft.Extensions.Configuration;
namespace
HYH.Registry.EntityFrameworkCore
{
/* This class is needed to run EF Core PMC commands. Not used anywhere else */
public
class
RegistryDbContextFactory
:
IDesignTimeDbContextFactory
<
Registry
DbContext
>
public
class
RegistryDbContextFactory
:
IDesignTimeDbContextFactory
<
Platform
DbContext
>
{
public
Registry
DbContext
CreateDbContext
(
string
[]
args
)
public
Platform
DbContext
CreateDbContext
(
string
[]
args
)
{
var
builder
=
new
DbContextOptionsBuilder
<
Registry
DbContext
>();
var
builder
=
new
DbContextOptionsBuilder
<
Platform
DbContext
>();
var
configuration
=
AppConfigurations
.
Get
(
WebContentDirectoryFinder
.
CalculateContentRootFolder
());
DbContextOptionsConfigurer
.
Configure
(
...
...
@@ -19,7 +19,7 @@ namespace HYH.Registry.EntityFrameworkCore
configuration
.
GetConnectionString
(
RegistryConsts
.
ConnectionStringName
)
);
return
new
Registry
DbContext
(
builder
.
Options
);
return
new
Platform
DbContext
(
builder
.
Options
);
}
}
}
\ No newline at end of file
src/HYH.Registry.EntityFrameworkCore/EntityFrameworkCore/RegistryEntityFrameworkCoreModule.cs
View file @
12b488dc
...
...
@@ -19,7 +19,7 @@ namespace HYH.Registry.EntityFrameworkCore
Configuration
.
ReplaceService
<
IConnectionStringResolver
,
ConnectionStringResolver
>();
// Configure first DbContext
Configuration
.
Modules
.
AbpEfCore
().
AddDbContext
<
Registry
DbContext
>(
options
=>
Configuration
.
Modules
.
AbpEfCore
().
AddDbContext
<
Platform
DbContext
>(
options
=>
{
if
(
options
.
ExistingConnection
!=
null
)
{
...
...
src/HYH.Registry.Web.Host/HYH.Registry.Application.xml
View file @
12b488dc
...
...
@@ -48,7 +48,7 @@
</summary>
</member>
<member
name=
"M:HYH.Registry.Services.Encryption.EncryptionService.#ctor(HYH.AspNetCore.ICurrentUser,Abp.Domain.Repositories.IRepository{HYH.Core.DbModels.Tenant,System.Int32})"
>
<member
name=
"M:HYH.Registry.Services.Encryption.EncryptionService.#ctor(HYH.AspNetCore.ICurrentUser,
HYH.SqlSugarCore.DbContext{HYH.Core.DbModels.Tenant},Abp.Domain.Repositories.IRepository{HYH.Registry.DbModels.MaterialPowder,System.Int32},
Abp.Domain.Repositories.IRepository{HYH.Core.DbModels.Tenant,System.Int32})"
>
<summary>
构造函数
</summary>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment