parent
cc82434314
commit
84dd2cd4ed
@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace contacts
|
||||
{
|
||||
public class PeopleContext : DbContext
|
||||
{
|
||||
public DbSet<Person> People { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
||||
=> options.UseSqlite("Data Source=people.db");
|
||||
}
|
||||
|
||||
public class Person
|
||||
{
|
||||
public int PersonId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Age { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace contacts
|
||||
{
|
||||
public class Person
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public int age { get; set; }
|
||||
public Person(int idParam, string nameParam, int ageParam)
|
||||
{
|
||||
|
||||
this.id = idParam;
|
||||
this.name = nameParam;
|
||||
this.age = ageParam;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue