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
80406124
Commit
80406124
authored
Jun 27, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update samples
parent
8b2a6ee7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
Startup.cs
samples/Sample.Kafka/Startup.cs
+14
-5
No files found.
samples/Sample.Kafka/Startup.cs
View file @
80406124
...
@@ -8,7 +8,8 @@ namespace Sample.Kafka
...
@@ -8,7 +8,8 @@ namespace Sample.Kafka
{
{
public
class
Startup
public
class
Startup
{
{
public
Startup
(
IHostingEnvironment
env
)
{
public
Startup
(
IHostingEnvironment
env
)
{
var
builder
=
new
ConfigurationBuilder
()
var
builder
=
new
ConfigurationBuilder
()
.
SetBasePath
(
env
.
ContentRootPath
)
.
SetBasePath
(
env
.
ContentRootPath
)
.
AddJsonFile
(
"appsettings.json"
,
optional
:
false
,
reloadOnChange
:
true
)
.
AddJsonFile
(
"appsettings.json"
,
optional
:
false
,
reloadOnChange
:
true
)
...
@@ -20,19 +21,27 @@ namespace Sample.Kafka
...
@@ -20,19 +21,27 @@ namespace Sample.Kafka
public
IConfigurationRoot
Configuration
{
get
;
}
public
IConfigurationRoot
Configuration
{
get
;
}
// This method gets called by the runtime. Use this method to add services to the container.
// This method gets called by the runtime. Use this method to add services to the container.
public
void
ConfigureServices
(
IServiceCollection
services
)
{
public
void
ConfigureServices
(
IServiceCollection
services
)
{
services
.
AddDbContext
<
AppDbContext
>();
services
.
AddDbContext
<
AppDbContext
>();
services
.
AddConsistency
()
services
.
AddConsistency
()
.
AddEntityFrameworkStores
<
AppDbContext
>()
.
AddEntityFrameworkStores
<
AppDbContext
>()
.
AddKafka
();
.
AddRabbitMQ
(
x
=>
{
x
.
HostName
=
"192.168.2.206"
;
x
.
UserName
=
"admin"
;
x
.
Password
=
"123123"
;
});
//.AddKafka();
// Add framework services.
// Add framework services.
services
.
AddMvc
();
services
.
AddMvc
();
}
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public
void
Configure
(
IApplicationBuilder
app
,
IHostingEnvironment
env
,
ILoggerFactory
loggerFactory
)
{
public
void
Configure
(
IApplicationBuilder
app
,
IHostingEnvironment
env
,
ILoggerFactory
loggerFactory
)
{
loggerFactory
.
AddConsole
(
Configuration
.
GetSection
(
"Logging"
));
loggerFactory
.
AddConsole
(
Configuration
.
GetSection
(
"Logging"
));
loggerFactory
.
AddDebug
();
loggerFactory
.
AddDebug
();
...
...
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