您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

26 行
848 B

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using DotNetCore.CAP.Infrastructure;
  6. using JetBrains.Annotations;
  7. using Microsoft.EntityFrameworkCore;
  8. namespace Sample.Kafka
  9. {
  10. public class AppDbContext : DbContext
  11. {
  12. public DbSet<ConsistencyMessage> Messages { get; set; }
  13. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
  14. optionsBuilder.UseSqlServer("Server=192.168.2.206;Initial Catalog=Test;User Id=cmswuliu;Password=h7xY81agBn*Veiu3;MultipleActiveResultSets=True");
  15. }
  16. protected override void OnModelCreating(ModelBuilder modelBuilder) {
  17. modelBuilder.Entity<ConsistencyMessage>().Property(x => x.RowVersion).IsConcurrencyToken();
  18. base.OnModelCreating(modelBuilder);
  19. }
  20. }
  21. }