Hi, I have implemented it as shown below.But it gives the same error.May be I have implemented it wrongly. Please see that.
Note : I have tried by giving this also "IpLegacyDbContext" instead of the "IpDbContext" .But the same error.May be fundamental issue where I have implemented this. Hope you'll corrected me.
ILegacyRepository.cs
public interface ILegacyRepository<TEntity, TPrimaryKey> : IRepository<TEntity, TPrimaryKey>
where TEntity : class, IEntity<TPrimaryKey>
{
}
public interface ILegacyRepository<TEntity> : IRepository<TEntity>
where TEntity : class, IEntity<int>
{
}
IpLegacyRepositoryBase.cs
/// <summary>
/// Base class for custom repositories of the application.
/// </summary>
/// <typeparam name="TEntity">Entity type</typeparam>
/// <typeparam name="TPrimaryKey">Primary key type of the entity</typeparam>
public abstract class IpLegacyRepositoryBase<TEntity, TPrimaryKey> : EfRepositoryBase<IpDbContext, TEntity, TPrimaryKey>
where TEntity : class, IEntity<TPrimaryKey>
{
protected IpLegacyRepositoryBase(IDbContextProvider<IpDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
//add your common methods for all repositories
}
/// <summary>
/// Base class for custom repositories of the application.
/// This is a shortcut of <see cref="IPRepositoryBase{TEntity,TPrimaryKey}"/> for <see cref="int"/> primary key.
/// </summary>
/// <typeparam name="TEntity">Entity type</typeparam>
public abstract class IpLegacyRepositoryBase<TEntity> : IpLegacyRepositoryBase<TEntity, int>
where TEntity : class, IEntity<int>
{
protected IpLegacyRepositoryBase(IDbContextProvider<IpDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
//do not add any method here, add to the class above (since this inherits it)!!!
}
IpLegacyDbContext.cs
[AutoRepositoryTypes(typeof(ILegacyRepository<>), typeof(ILegacyRepository<,>), typeof(IpLegacyRepositoryBase<>), typeof(IpLegacyRepositoryBase<,>))]
public class IpLegacyDbContext : AbpZeroDbContext<Tenant, Role, User>
{
public IpLegacyDbContext()
: base("Legacy")
{
}
public virtual DbSet<Agent> Agents { get; set; }
public virtual DbSet<AgentContact> AgentContacts { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<BuyerInformation>()
.Property(e => e.Buyerpricerangelow)
.HasPrecision(19, 4);
modelBuilder.Entity<BuyerInformation>()
.Property(e => e.Buyerpricerangehigh)
.HasPrecision(19, 4);
}
}
Hi,
Can you tell me which layers should I use to implement above mentioned class and interface ?
If you can explain about this process or behind the scene things where it'll really help to me.Thanks.
Hi, I'm sorry.Still not clear for me.Could you tell me after the above implementation how about this line ?
public class IpLegacyDbContext : AbpZeroDbContext<Tenant, Role, User>
You have mentioned about this "ILegacyRepository<User, long>".Which place do I inject this ? Thanks.
Note : Actually this is working fine on 'version="0.8.4.0"'.I still have that copy and working fine.But anyway I have to do the changes according to the new version no.Please provide a feedback for the above query.Thanks.
Hi, I do have 1 database for both tenant and host.These contexts are used for both. I'm not using second repository interface type.Can you tell me how to do that ? We're using "IpLegacyDbContext" for retrieving the Access app's data into SQL db. That is the only job of that context.It's kind of one time usage.Thanks.
Hi,
Yes,It is like this.
public class IpDbContext : AbpZeroDbContext<Tenant, Role, User>
and
public class IpLegacyDbContext : AbpZeroDbContext<Tenant, Role, User>
Please tell me what should I do.Thanks.
Hi, Thanks for the feedback. Actually I don't need to change any existing ABP's js files into TS.I just need to change my app's custom js files only.B'cos ABP owners will upgrade it later when they'll release the Angular 2 compatible version.So is that kind of thing possible ? That means without changing any framework related js files where I just need to convert my app's custom js files only.I don't even like to touch the app.js file .Can I do that kind of convert ? Thanks.
Hi,
You're the man.Thanks a lot.You have removed huge pain of me :)
#if DEBUG
private static readonly Lazy<ConnectionMultiplexer> LazyConnection = new Lazy<ConnectionMultiplexer>(() => ConnectionMultiplexer.Connect("localhost,ConnectTimeout=10000"));//local host
#else
private static readonly Lazy<ConnectionMultiplexer> LazyConnection = new Lazy<ConnectionMultiplexer>(() => ConnectionMultiplexer.Connect("MyRedis.redis.cache.windows.net:6380,password=mypassord,ssl=True,abortConnect=False"));//production
#endif
public static ConnectionMultiplexer Connection => LazyConnection.Value;
Hi,
Yes,I have updated the cache details.Please see that.
Yes,I need to do it on the PostInitialize()
method.Could you tell me how to do that ? The above mentioned cache details have been implemented on the Application layer.Thanks.
I'll do that and will let you know if I'll have any issues.Thanks a lot :)