Un-able to access dbcontext in Repository class
Hi,i am using EF and Mysql Identity in my application. Mysql Identity is working fine..but i am un-able to access DBContext in Repository clasess.
this is my dbcontext class..
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext(): base("DefaultConnection", throwIfV1Schema: false)
{
}
static ApplicationDbContext()
{
Database.SetInitializer(new MySqlInitializer());
}
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
public DbSet<UserProfile> UserProfile { get; set; }
}
This is Repository class:
using (var context = new ApplicationDbContext())
{
}
i am getting error :
applicationdbcontext:type used in using statment must be implicitly converted to system.Idisposable
Please help me out what i am doing wrong ?..