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
c3ab51f3
Commit
c3ab51f3
authored
Feb 11, 2019
by
Savorboard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update docs
parent
c2fb20fc
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
26 deletions
+78
-26
about.md
docs/about.md
+0
-5
api-interface.md
docs/user-guide-cn/api-interface.md
+4
-4
api-interface.md
docs/user-guide/api-interface.md
+8
-8
configuration.md
docs/user-guide/configuration.md
+1
-1
faq.md
docs/user-guide/faq.md
+1
-1
getting-started.md
docs/user-guide/getting-started.md
+1
-1
mkdocs.yml
mkdocs.yml
+63
-6
No files found.
docs/about.md
deleted
100644 → 0
View file @
c2fb20fc
## Contact Us
*
Submit an issue
*
Email: yangxiaodong1214@126.com
\ No newline at end of file
docs/user-guide-cn/api-interface.md
View file @
c3ab51f3
...
...
@@ -4,7 +4,7 @@ CAP 的 API 接口只有一个,就是 `ICapPublisher` 接口,你可以从 DI
你可以使用
`ICapPublisher`
接口中的
`Publish<T>`
或者
`PublishAsync<T>`
方法来发送消息:
```
c
s
```
c
#
public
class
PublishController
:
Controller
{
private
readonly
ICapPublisher
_capBus
;
...
...
@@ -109,7 +109,7 @@ public DateTime ShowPublishTimeAndReturnExecuteTime(DateTime time)
*
EntityFramework
```
c
s
```
c
#
using
(
var
trans
=
dbContext
.
Database
.
BeginTransaction
(
_capBus
,
autoCommit
:
false
)
{
//业务代码
...
...
@@ -128,7 +128,7 @@ using (var trans = dbContext.Database.BeginTransaction(_capBus, autoCommit: fals
*
Dapper
```
c
s
```
c
#
using
(
var
connection
=
new
MySqlConnection
(
ConnectionString
))
{
using
(
var
transaction
=
connection
.
BeginTransaction
(
_capBus
,
autoCommit
:
false
))
...
...
@@ -201,7 +201,7 @@ public void BarAndFooMessageProcessor()
以下是使用组进行订阅的示例:
```
c
s
```
c
#
[
CapSubscribe
(
"xxx.services.foo"
,
Group
=
"moduleA"
)]
public
void
FooMessageProcessor
()
{
...
...
docs/user-guide/api-interface.md
View file @
c3ab51f3
...
...
@@ -6,7 +6,7 @@ CAP only has one interface,It is `ICapPublisher`, You can get its instance from
You can use the
`Publish<T>`
or
`PublishAsync<T>`
methods defined in the
`ICapPublisher`
interface to send the event messages.
```
c
s
```
c
#
public
class
PublishController
:
Controller
{
private
readonly
ICapPublisher
_capBus
;
...
...
@@ -48,7 +48,7 @@ public class PublishController : Controller
```
The following is the signature of the of the PublishAsync method
```
c
s
```
c
#
PublishAsync
<
T
>(
string
name
,
T
object
)
```
...
...
@@ -58,7 +58,7 @@ and then write messages into the `Cap.Published` message table.
In some situations,you may need a callback when a message is sent out, you can use the follwing
overload of the
`PublishAsync<T>`
method:
```
c
s
```
c
#
PublishAsync
<
T
>(
string
name
,
T
object
,
string
callBackName
)
```
...
...
@@ -80,7 +80,7 @@ The following two blocks of code snippet demonstrate how to use transactions in
#### EntityFramework
```
c
s
```
c
#
using
(
var
trans
=
dbContext
.
Database
.
BeginTransaction
(
_capBus
,
autoCommit
:
false
)
{
// Your business logic。
...
...
@@ -99,7 +99,7 @@ During the course,the message content will be serialized as json and stored in t
#### Dapper
```
c
s
```
c
#
using
(
var
connection
=
new
MySqlConnection
(
ConnectionString
))
{
using
(
var
transaction
=
connection
.
BeginTransaction
(
_capBus
,
autoCommit
:
false
))
...
...
@@ -123,7 +123,7 @@ using (var connection = new MySqlConnection(ConnectionString))
Use
`CapSubscribe[""]`
to decorate a method so that it can subscribe messages published by CAP.
```
c
s
```
c
#
[
CapSubscribe
(
"xxx.services.bar"
)]
public
void
BarMessageProcessor
()
{
...
...
@@ -131,7 +131,7 @@ public void BarMessageProcessor()
```
You can also use multiple
`CapSubscribe[""]`
to decorate a method so that you can subscribe messages from different sources accordingly.
```
c
s
```
c
#
[
CapSubscribe
(
"xxx.services.bar"
)]
[
CapSubscribe
(
"xxx.services.foo"
)]
public
void
BarAndFooMessageProcessor
()
...
...
@@ -162,7 +162,7 @@ If you do not specify any group when subscribing,CAP will put the subscriber int
the following is a demo shows how to use group when subscribing.
```
c
s
```
c
#
[
CapSubscribe
(
"xxx.services.foo"
,
Group
=
"moduleA"
)]
public
void
FooMessageProcessor
()
{
...
...
docs/user-guide/configuration.md
View file @
c3ab51f3
...
...
@@ -140,7 +140,7 @@ Note that if you are using EntityFramewrok, you do not use this configuration it
CAP uses PostgreSql configuration functions for CapOptions extensions, so the configuration usage for PostgreSql is as follows:
```
c
s
```
c
#
services
.
AddCap
(
capOptions
=>
{
capOptions
.
UsePostgreSql
(
postgreOptions
=>
{
// postgreOptions.ConnectionString
...
...
docs/user-guide/faq.md
View file @
c3ab51f3
...
...
@@ -16,7 +16,7 @@ defining a prefix name of table in `ConfigureServices` method。
codes exsample:
```
c
s
```
c
#
public
void
ConfigureServices
(
IServiceCollection
services
)
{
services
.
AddCap
(
x
=>
...
...
docs/user-guide/getting-started.md
View file @
c3ab51f3
...
...
@@ -59,7 +59,7 @@ PM> Install-Package DotNetCore.CAP.MongoDB
In an ASP.NET Core program, you can configure the services used by the CAP in the
`Startup.cs`
file
`ConfigureServices()`
:
```
c
s
```
c
#
public
void
ConfigureServices
(
IServiceCollection
services
)
{
//......
...
...
mkdocs.yml
View file @
c3ab51f3
# Project information
site_name
:
CAP
site_url
:
https://cap.dotnet-chain.org
site_description
:
Project documentation with Markdown.
site_author
:
CAP Team
repo_name
:
'
dotnetcore/CAP'
repo_url
:
'
https://github.com/dotnetcore/cap'
# Copyright
copyright
:
Copyright © 2017 <a href="https://github.com/dotnetcore">.NET Core Community</a>, Maintained by the <a href="/about/contact-us/#cap-team">CAP Team</a>.
nav
:
-
Home
:
index.md
-
<img src="https://www.countryflags.io/us/flat/16.png">
User Guide
:
-
User Guide
:
-
Getting Started
:
user-guide/getting-started.md
-
API Interface
:
user-guide/api-interface.md
-
Configuration
:
user-guide/configuration.md
...
...
@@ -9,7 +19,7 @@ nav:
-
Implementation Mechanisms
:
user-guide/implementation-mechanisms.md
-
Distributed Transactions
:
user-guide/distributed-transactions.md
-
FAQ
:
user-guide/faq.md
-
<img src="https://www.countryflags.io/cn/flat/16.png">
使用指南
:
-
使用指南
:
-
快速开始
:
user-guide-cn/getting-started.md
-
API 接口
:
user-guide-cn/api-interface.md
-
配置
:
user-guide-cn/configuration.md
...
...
@@ -17,8 +27,55 @@ nav:
-
实现
:
user-guide-cn/implementation-mechanisms.md
-
分布式事务
:
user-guide-cn/distributed-transactions.md
-
FAQ
:
user-guide-cn/faq.md
-
About
:
about.md
theme
:
cinder
-
About
:
-
Release Notes
:
about/release-notes.md
-
Contributing
:
about/contributing.md
-
Contact Us
:
about/contact-us.md
#theme: material
theme
:
name
:
'
material'
palette
:
primary
:
'
purple'
accent
:
'
indigo'
logo
:
icon
:
'
cloud'
language
:
'
en'
#favicon: 'assets/images/favicon.ico'
feature
:
tabs
:
true
#Search
extra
:
search
:
language
:
'
en,
zh'
# Extensions
markdown_extensions
:
-
admonition
repo_url
:
"
https://github.com/dotnetcore/CAP"
\ No newline at end of file
-
markdown.extensions.admonition
-
markdown.extensions.codehilite
:
guess_lang
:
true
-
markdown.extensions.def_list
-
markdown.extensions.footnotes
-
markdown.extensions.meta
-
markdown.extensions.toc
:
permalink
:
true
-
pymdownx.arithmatex
-
pymdownx.betterem
:
smart_enable
:
all
-
pymdownx.caret
-
pymdownx.critic
-
pymdownx.details
-
pymdownx.emoji
:
emoji_generator
:
!!python/name:pymdownx.emoji.to_svg
-
pymdownx.inlinehilite
-
pymdownx.keys
-
pymdownx.magiclink
:
repo_url_shorthand
:
true
user
:
dotnetcore
repo
:
cap
-
pymdownx.mark
-
pymdownx.smartsymbols
-
pymdownx.superfences
-
pymdownx.tasklist
:
custom_checkbox
:
true
-
pymdownx.tilde
\ No newline at end of file
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