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
09de13b3
Commit
09de13b3
authored
Oct 20, 2018
by
Savorboard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com:dotnetcore/CAP into develop
parents
a2aa4464
b6311f4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
README.md
README.md
+8
-5
No files found.
README.md
View file @
09de13b3
...
@@ -104,7 +104,7 @@ public class PublishController : Controller
...
@@ -104,7 +104,7 @@ public class PublishController : Controller
{
{
using
(
var
transaction
=
connection
.
BeginTransaction
(
_capBus
,
autoCommit
:
true
))
using
(
var
transaction
=
connection
.
BeginTransaction
(
_capBus
,
autoCommit
:
true
))
{
{
//your business code
//your business
logic
code
_capBus
.
Publish
(
"xxx.services.show.time"
,
DateTime
.
Now
);
_capBus
.
Publish
(
"xxx.services.show.time"
,
DateTime
.
Now
);
}
}
...
@@ -118,7 +118,7 @@ public class PublishController : Controller
...
@@ -118,7 +118,7 @@ public class PublishController : Controller
{
{
using
(
var
trans
=
dbContext
.
Database
.
BeginTransaction
(
_capBus
,
autoCommit
:
true
))
using
(
var
trans
=
dbContext
.
Database
.
BeginTransaction
(
_capBus
,
autoCommit
:
true
))
{
{
//your business code
//your business
logic
code
_capBus
.
Publish
(
"xxx.services.show.time"
,
DateTime
.
Now
);
_capBus
.
Publish
(
"xxx.services.show.time"
,
DateTime
.
Now
);
}
}
...
@@ -131,7 +131,7 @@ public class PublishController : Controller
...
@@ -131,7 +131,7 @@ public class PublishController : Controller
### Subscribe
### Subscribe
**In
Action Method
**
**In
Controller Action
**
Add the Attribute
`[CapSubscribe()]`
on Action to subscribe message:
Add the Attribute
`[CapSubscribe()]`
on Action to subscribe message:
...
@@ -147,7 +147,7 @@ public class PublishController : Controller
...
@@ -147,7 +147,7 @@ public class PublishController : Controller
```
```
**In
Service Method
**
**In
Business Logic Service
**
If your subscribe method is not in the Controller,then your subscribe class need to Inheritance
`ICapSubscribe`
:
If your subscribe method is not in the Controller,then your subscribe class need to Inheritance
`ICapSubscribe`
:
...
@@ -179,7 +179,10 @@ public void ConfigureServices(IServiceCollection services)
...
@@ -179,7 +179,10 @@ public void ConfigureServices(IServiceCollection services)
//Note: The injection of services needs before of `services.AddCap()`
//Note: The injection of services needs before of `services.AddCap()`
services
.
AddTransient
<
ISubscriberService
,
SubscriberService
>();
services
.
AddTransient
<
ISubscriberService
,
SubscriberService
>();
services
.
AddCap
(
x
=>{});
services
.
AddCap
(
x
=>
{
//...
});
}
}
```
```
...
...
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