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
5568daa8
Commit
5568daa8
authored
Jun 13, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update sample.
parent
0a531c88
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
21 deletions
+6
-21
ValuesController.cs
samples/Sample.Kafka/Controllers/ValuesController.cs
+1
-3
Program.cs
samples/Sample.Kafka/Program.cs
+3
-8
Startup.cs
samples/Sample.Kafka/Startup.cs
+2
-10
No files found.
samples/Sample.Kafka/Controllers/ValuesController.cs
View file @
5568daa8
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Cap.Consistency.Consumer
;
using
Cap.Consistency.Consumer
;
using
Cap.Consistency.Kafka
;
using
Cap.Consistency.Kafka
;
...
...
samples/Sample.Kafka/Program.cs
View file @
5568daa8
using
System
;
using
System.IO
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Hosting
;
...
@@ -10,8 +6,7 @@ namespace Sample.Kafka
...
@@ -10,8 +6,7 @@ namespace Sample.Kafka
{
{
public
class
Program
public
class
Program
{
{
public
static
void
Main
(
string
[]
args
)
public
static
void
Main
(
string
[]
args
)
{
{
var
host
=
new
WebHostBuilder
()
var
host
=
new
WebHostBuilder
()
.
UseKestrel
()
.
UseKestrel
()
.
UseContentRoot
(
Directory
.
GetCurrentDirectory
())
.
UseContentRoot
(
Directory
.
GetCurrentDirectory
())
...
...
samples/Sample.Kafka/Startup.cs
View file @
5568daa8
using
System
;
using
Microsoft.AspNetCore.Builder
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Cap.Consistency.Infrastructure
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Logging
;
...
@@ -27,7 +21,6 @@ namespace Sample.Kafka
...
@@ -27,7 +21,6 @@ namespace Sample.Kafka
// 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
()
...
@@ -38,7 +31,6 @@ namespace Sample.Kafka
...
@@ -38,7 +31,6 @@ namespace Sample.Kafka
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"
));
...
...
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