I wrote my own context by reading this article and many others, but none of theme explains where is this context.Entry(obj)
defined, I mean even by reading this article, I cant understand how to implement this method, and I get the following error :
Error 36 'Domain.Entities.OurWebSiteContext' does not contain a
definition for 'Entry' and no extension method 'Entry' accepting a
first argument of type 'Domain.Entities.OurWebSiteContext' could be
found (are you missing a using directive or an assembly reference?)
Somebody help me out please
Edited >>
public class OurWebSiteContext : DbContext
{
public OurWebSiteContext(string connString)
: base(connString)
{
}
public DbSet<Article> Articles { get; set; }
public DbSet<Category> Categories { get; set; }
public DbSet<Comment> Comments { get; set; }
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…