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.
 
 
 

24 lines
573 B

  1. using Microsoft.EntityFrameworkCore;
  2. namespace Sample.RabbitMQ.MySql
  3. {
  4. public class Person
  5. {
  6. public int Id { get; set; }
  7. public string Name { get; set; }
  8. }
  9. public class AppDbContext : DbContext
  10. {
  11. public const string ConnectionString = "Server=localhost;Database=testcap;UserId=root;Password=123123;";
  12. public DbSet<Person> Persons { get; set; }
  13. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  14. {
  15. optionsBuilder.UseMySql(ConnectionString);
  16. }
  17. }
  18. }