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.
 
 
 

29 line
627 B

  1. using Microsoft.EntityFrameworkCore;
  2. namespace Sample.RabbitMQ.SqlServer
  3. {
  4. public class Person
  5. {
  6. public int Id { get; set; }
  7. public string Name { get; set; }
  8. public override string ToString()
  9. {
  10. return $"Name:{Name}, Id:{Id}";
  11. }
  12. }
  13. public class AppDbContext : DbContext
  14. {
  15. public const string ConnectionString = "";
  16. public DbSet<Person> Persons { get; set; }
  17. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  18. {
  19. optionsBuilder.UseSqlServer(ConnectionString);
  20. }
  21. }
  22. }