Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
丁松杰
/
Pole
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e2141433
authored
Feb 20, 2020
by
dingsongjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除 不必要的 类
parent
7819603e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
53 deletions
src/Pole.Orleans.Provider.EntityframeworkCore/DefaultGrainStateEntryConfigurator.cs
src/Pole.Orleans.Provider.EntityframeworkCore/Extensions/GrainStorageServiceCollectionExtensions.cs
src/Pole.Orleans.Provider.EntityframeworkCore/GrainStorage.cs
src/Pole.Orleans.Provider.EntityframeworkCore/IGrainStateEntryConfigurator.cs
src/Pole.Orleans.Provider.EntityframeworkCore/DefaultGrainStateEntryConfigurator.cs
deleted
100644 → 0
View file @
7819603e
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.ChangeTracking
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Pole.Orleans.Provider.EntityframeworkCore
{
public
class
DefaultGrainStateEntryConfigurator
<
TContext
,
TGrain
,
TEntity
>
:
IGrainStateEntryConfigurator
<
TContext
,
TGrain
,
TEntity
>
where
TContext
:
DbContext
where
TEntity
:
class
{
public
void
ConfigureSaveEntry
(
ConfigureSaveEntryContext
<
TContext
,
TEntity
>
context
)
{
if
(
context
.
IsPersisted
)
{
// todo update necessary table
//EntityEntry<TEntity> entry = context.DbContext.Set<TEntity>().Update(context.Entity);
}
else
{
EntityEntry
<
TEntity
>
entry
=
context
.
DbContext
.
Set
<
TEntity
>().
Add
(
context
.
Entity
);
}
//entry.State = context.IsPersisted
// ? EntityState.Modified
// : EntityState.Added;
}
}
}
src/Pole.Orleans.Provider.EntityframeworkCore/Extensions/GrainStorageServiceCollectionExtensions.cs
View file @
e2141433
...
...
@@ -55,8 +55,6 @@ namespace Pole.Orleans.Provider.EntityframeworkCore
{
services
.
TryAddSingleton
(
typeof
(
IEntityTypeResolver
),
typeof
(
EntityTypeResolver
));
services
.
TryAddSingleton
(
typeof
(
IGrainStorageConvention
),
typeof
(
GrainStorageConvention
));
services
.
TryAddSingleton
(
typeof
(
IGrainStateEntryConfigurator
<,,>),
typeof
(
DefaultGrainStateEntryConfigurator
<,,>));
services
.
AddSingleton
(
typeof
(
EntityFrameworkGrainStorage
<
TContext
>));
services
.
TryAddSingleton
<
IGrainStorage
>(
sp
=>
...
...
src/Pole.Orleans.Provider.EntityframeworkCore/GrainStorage.cs
View file @
e2141433
...
...
@@ -28,7 +28,6 @@ namespace Pole.Orleans.Provider.EntityframeworkCore
private
readonly
IServiceScopeFactory
_scopeFactory
;
private
readonly
ILogger
<
GrainStorage
<
TContext
,
TGrain
,
TGrainState
,
TEntity
>>
_logger
;
private
readonly
IServiceProvider
_serviceProvider
;
private
readonly
IGrainStateEntryConfigurator
<
TContext
,
TGrain
,
TEntity
>
_entryConfigurator
;
public
GrainStorage
(
string
grainType
,
IServiceProvider
serviceProvider
)
{
...
...
@@ -37,9 +36,6 @@ namespace Pole.Orleans.Provider.EntityframeworkCore
_serviceProvider
=
serviceProvider
??
throw
new
ArgumentNullException
(
nameof
(
serviceProvider
));
_entryConfigurator
=
(
IGrainStateEntryConfigurator
<
TContext
,
TGrain
,
TEntity
>)
serviceProvider
.
GetRequiredService
(
typeof
(
IGrainStateEntryConfigurator
<
TContext
,
TGrain
,
TEntity
>));
var
loggerFactory
=
_serviceProvider
.
GetService
<
ILoggerFactory
>();
_logger
=
loggerFactory
?.
CreateLogger
<
GrainStorage
<
TContext
,
TGrain
,
TGrainState
,
TEntity
>>()
??
NullLogger
<
GrainStorage
<
TContext
,
TGrain
,
TGrainState
,
TEntity
>>.
Instance
;
...
...
src/Pole.Orleans.Provider.EntityframeworkCore/IGrainStateEntryConfigurator.cs
deleted
100644 → 0
View file @
7819603e
using
Microsoft.EntityFrameworkCore
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Pole.Orleans.Provider.EntityframeworkCore
{
public
interface
IGrainStateEntryConfigurator
<
TContext
,
TGrain
,
TEntity
>
where
TContext
:
DbContext
where
TEntity
:
class
{
void
ConfigureSaveEntry
(
ConfigureSaveEntryContext
<
TContext
,
TEntity
>
context
);
}
}
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