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.
23 lines
582 B
23 lines
582 B
using Microsoft.EntityFrameworkCore;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace AspNetCoreMVC.Models
|
|
{
|
|
[Table("Person")]
|
|
public class Person
|
|
{
|
|
public int Id { get; set; }
|
|
public string Name { get; set; }
|
|
}
|
|
|
|
public class PersonDbContext : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
string connectionString = "server=peacecloud.synology.me,21433;database=study;uid=study;pwd=Study1234";
|
|
optionsBuilder.UseSqlServer(connectionString);
|
|
}
|
|
|
|
public DbSet<Person> Persons { get; set; }
|
|
}
|
|
}
|
|
|