Base solution for your next web application

Activities of "sison"

How could i create a seed to insert default data to the last created Db with multi tenancy?. or should I use any other method to insert default data..?

I need to insert some data to new Db at the time when i create new tenancy.I have created a seed method with tenant Id 1, as described in sample application. but it not works for me,the data are inserted into main Db only.

Question

Hi,

I have created a generic repository to write common method for all repositories. but it is not working for me. what i have done is, created IGenericRepository under core and implemented IRepository then created GenericRepository under EnitityFramework and implemented SampleProBaseRepository as well as IGenericRepository(Codes are bellow).

This is not working for me, please cross check the code and let me know if there any mistake i did or i should add some more code to the work the same.

IGenericRepository:

public interface IGenericRepository<TEntity, TPrimaryKey> : IRepository<TEntity, TPrimaryKey> where TEntity : class,IEntity<TPrimaryKey>
    {
        Task SaveChangesAsync();
    }
    public interface IGenericRepository<TEntity> : IRepository<TEntity> where TEntity : class,IEntity<int>
    {
        Task SaveChangesAsync();
    }

GenericRepository

public class GenericRepository<TEntity, PrimaryKey> : SampleRepositoryBase<TEntity, PrimaryKey>, IGenericRepository<TEntity, PrimaryKey> where TEntity : class,IEntity<PrimaryKey>
    {
        protected GenericRepository(IDbContextProvider<SampleDbContext> dbContextProvider)
            : base(dbContextProvider)
        {

        }

        public async Task SaveChangesAsync()
        {
            await Context.SaveChangesAsync();
        }
    }
    public class GenericRepository<TEntity> : SampleRepositoryBase<TEntity>, IGenericRepository<TEntity>  where TEntity : class,IEntity<int>
    {
        protected GenericRepository(IDbContextProvider<SampleDbContext> dbContextProvider)
            : base(dbContextProvider)
        {

        }

        public async Task SaveChangesAsync()
        {
            await Context.SaveChangesAsync();
        }
    }

thanks for the help, but one more problem is i couldn't insert new created tenant Id to the table with seed data before login.

Answer

But I have tried register Generic Repository like follows,

IocManager.Register(typeof(IGenericRepository<>),
              typeof(GenericRepository<>),
              Abp.Dependency.DependencyLifeStyle.Transient);

this been resulted the same.

Hi,

A unhandled exception comes when i inspect element from browser. exception is:

The controller for path '/Scripts/toastr.js.map' was not found or does not implement IController.

i dont understand why it comes always. The toaster.js is already there in same path im using VS 2013.

Answer

Hi,

I have tried register generic repository the way you mentioned. but it showing some build error like "using the generic type 'Sample.Repository.GenericRepository<TEntity>' requires 1 type argument" . so are gonna say i must me register all entity separately at preinitialize..?

Question

HI,

I need to add dynamic roles and have sufficient permissions to roles we created. is that possible in boiler plate?? if yes please narrate me how!!

How could i change login user only if email confirmed! please let me know if that functionality already exists in boiler plate!! :?:

Question

Hi,

What should i do if i have Sub Menus! is there any option to show sub menus with permission??

Hey!

that works! thanks for your kind information. :)

Showing 1 to 10 of 14 entries