Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
tsai
CAP
Commits
a575bd67
Commit
a575bd67
authored
May 06, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor
parent
4fc6a4d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
ObjectMethodExecutor.cs
src/Cap.Consistency/Internal/ObjectMethodExecutor.cs
+6
-6
No files found.
src/Cap.Consistency/Internal/ObjectMethodExecutor.cs
View file @
a575bd67
...
...
@@ -25,7 +25,7 @@ namespace Cap.Consistency.Internal
MethodInfo
=
methodInfo
;
TargetTypeInfo
=
targetTypeInfo
;
Action
Parameters
=
methodInfo
.
GetParameters
();
Method
Parameters
=
methodInfo
.
GetParameters
();
MethodReturnType
=
methodInfo
.
ReturnType
;
IsMethodAsync
=
typeof
(
Task
).
IsAssignableFrom
(
MethodReturnType
);
TaskGenericType
=
IsMethodAsync
?
GetTaskInnerTypeOrNull
(
MethodReturnType
)
:
null
;
...
...
@@ -41,7 +41,7 @@ namespace Cap.Consistency.Internal
_executor
=
GetExecutor
(
methodInfo
,
targetTypeInfo
);
}
_parameterDefaultValues
=
GetParameterDefaultValues
(
Action
Parameters
);
_parameterDefaultValues
=
GetParameterDefaultValues
(
Method
Parameters
);
}
private
delegate
Task
<
object
>
ConsumerMethodExecutorAsync
(
object
target
,
object
[]
parameters
);
...
...
@@ -52,7 +52,7 @@ namespace Cap.Consistency.Internal
public
MethodInfo
MethodInfo
{
get
;
}
public
ParameterInfo
[]
Action
Parameters
{
get
;
}
public
ParameterInfo
[]
Method
Parameters
{
get
;
}
public
TypeInfo
TargetTypeInfo
{
get
;
}
...
...
@@ -70,16 +70,16 @@ namespace Cap.Consistency.Internal
return
executor
;
}
public
Task
<
object
>
ExecuteAsync
(
object
target
,
object
[]
parameters
)
{
public
Task
<
object
>
ExecuteAsync
(
object
target
,
params
object
[]
parameters
)
{
return
_executorAsync
(
target
,
parameters
);
}
public
object
Execute
(
object
target
,
object
[]
parameters
)
{
public
object
Execute
(
object
target
,
params
object
[]
parameters
)
{
return
_executor
(
target
,
parameters
);
}
public
object
GetDefaultValueForParameter
(
int
index
)
{
if
(
index
<
0
||
index
>
Action
Parameters
.
Length
-
1
)
{
if
(
index
<
0
||
index
>
Method
Parameters
.
Length
-
1
)
{
throw
new
ArgumentOutOfRangeException
(
nameof
(
index
));
}
...
...
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