我的问题如下:
在ApplicationDbContext中,我有一个DbSet客户端,在dbo表中,我有5条记录。当我尝试执行一些linQ查询时,尽管我有5条记录,但它会检索0条记录。我想我在课堂上缺少一些IEnumerable或什么?
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public DbSet<Carer> Carers { get; set; }
public DbSet<Appointment> Appointments { get; set; }
public DbSet<Client> Clients { get; set; }
}
public class Client
{
[Key]
public int IdClient { get; set; }
public string FullName { get; set; }
public string FullAdress { get; set; }
public string PostCode { get; set; }
public string PhoneNumber { get; set; }
}
var xx = _Context.Clients; // this returns 0 records