Browse Source

update sample.

master
yangxiaodong 7 years ago
parent
commit
5568daa847
3 changed files with 6 additions and 21 deletions
  1. +1
    -3
      samples/Sample.Kafka/Controllers/ValuesController.cs
  2. +3
    -8
      samples/Sample.Kafka/Program.cs
  3. +2
    -10
      samples/Sample.Kafka/Startup.cs

+ 1
- 3
samples/Sample.Kafka/Controllers/ValuesController.cs View File

@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Cap.Consistency.Consumer;
using Cap.Consistency.Kafka;
@@ -35,4 +33,4 @@ namespace Sample.Kafka.Controllers
return Ok();
}
}
}
}

+ 3
- 8
samples/Sample.Kafka/Program.cs View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.IO;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;

@@ -10,8 +6,7 @@ namespace Sample.Kafka
{
public class Program
{
public static void Main(string[] args)
{
public static void Main(string[] args) {
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
@@ -23,4 +18,4 @@ namespace Sample.Kafka
host.Run();
}
}
}
}

+ 2
- 10
samples/Sample.Kafka/Startup.cs View File

@@ -1,11 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Cap.Consistency.Infrastructure;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@@ -27,7 +21,6 @@ namespace Sample.Kafka

// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) {

services.AddDbContext<AppDbContext>();

services.AddConsistency()
@@ -38,7 +31,6 @@ namespace Sample.Kafka
services.AddMvc();
}


// 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) {
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
@@ -49,4 +41,4 @@ namespace Sample.Kafka
app.UseConsistency();
}
}
}
}

Loading…
Cancel
Save