You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 lines
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. }