i am crating plugin in nopcommerce 4.60.2 for this plugin i need DbContext and IDbContext but
IDbContext interface is not implementing it showing error 'are u missing any assemby'
any one no how to do this... any alternative
public ProductViewTrackerRecordObjectContext(DbContextOptions<ProductViewTrackerRecordObjectContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfiguration(new ProductViewTrackerRecordMap());
base.OnModelCreating(modelBuilder);
}
public new virtual DbSet<TEntity> Set<TEntity>() where TEntity : BaseEntity
{
return base.Set<TEntity>();
}
public virtual string GenerateCreateScript()
{
return Database.GenerateCreateScript();
}
public virtual IQueryable<TQuery> QueryFromSql<TQuery>(string sql) where TQuery : class
{
throw new NotImplementedException();
}
public virtual IQueryable<TEntity> EntityFromSql<TEntity>(string sql, params object[] parameters) where TEntity : BaseEntity
{
throw new NotImplementedException();
}
public virtual int ExecuteSqlCommand(RawSqlString sql, bool doNotEnsureTransaction = false, int? timeout = null, params object[] parameters)
{
using (var transaction = Database.BeginTransaction())
{
var result = Database.ExecuteSqlCommand(sql, parameters);
transaction.Commit();
return result;
}
}
public void Install()
{
//create the table
this.ExecuteSqlScript(GenerateCreateScript());
}
public void Uninstall()
{
//drop the table
this.DropPluginTable(nameof(ProductViewTrackerRecord));
}
public IList<TEntity> ExecuteStoredProcedureList<TEntity>(string commandText, params object[] parameters) where TEntity : BaseEntity, new()
{
throw new NotImplementedException();
}
public IEnumerable<TElement> SqlQuery<TElement>(string sql, params object[] parameters)
{
throw new NotImplementedException();
}
public int ExecuteSqlCommand(string sql, bool doNotEnsureTransaction = false, int? timeout = null, params object[] parameters)
{
throw new NotImplementedException();
}
public virtual void Detach<TEntity>(TEntity entity) where TEntity : BaseEntity
{
throw new NotImplementedException();
}
public IQueryable<TQuery> QueryFromSql<TQuery>(string sql, params object[] parameters) where TQuery : class
{
throw new NotImplementedException();
}
public virtual bool ProxyCreationEnabled
{
get => ProxyCreationEnabled;
set => ProxyCreationEnabled = value;
}
public virtual bool AutoDetectChangesEnabled
{
get => AutoDetectChangesEnabled;
set => AutoDetectChangesEnabled = value;
}
public class TrialTrackerRecord: BaseEntitypublic class TrailTrackerRecordMap : EntityTypeConfiguration<TrialTrackerRecord>
{
public int TrialTrackerId { get; set; }
public string CustomerName { get; set; }
public string CustomerEmail { get; set; }
public string ProductName { get; set; }
public int Productid { get; set; }
public string DownloadDate { get; set; }
public bool OnMailingList { get; set; }
}[code]