Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "doubledp"

Apologies for only replying now. The repositories is defined within the Entity Framework layer and the DTO's within the Application layer right?

Currently I have a 2nd dbContext class as per below:

using System.Data.Common;
using System.Data.Entity;
using Abp.EntityFramework;
using WebApplication.Storage;

namespace WebApplication.EntityFramework
{
    public class SecondDbContext : AbpDbContext
    {
        public virtual IDbSet<BinaryObject> BinaryObjects { get; set; }

        public SecondDbContext() 
            : base("Second")
        {

        }

        public SecondDbContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {

        }

        public SecondDbContext(DbConnection dbConnection)
            : base(dbConnection, true)
        {

        }
    }
}

Then I have added another it's equivalent base repository class as per below:

using Abp.Domain.Entities;
using Abp.EntityFramework;
using Abp.EntityFramework.Repositories;

namespace WebApplication.EntityFramework.Repositories
{
    public abstract class SecondRepositoryBase<TEntity, TPrimaryKey> : EfRepositoryBase<SecondDbContext, TEntity, TPrimaryKey>
        where TEntity : class, IEntity<TPrimaryKey>
    {
        protected SecondRepositoryBase(IDbContextProvider<SecondDbContext> dbContextProvider)
            : base(dbContextProvider)
        {

        }
    }

    public abstract class SecondRepositoryBase<TEntity> : SecondRepositoryBase<TEntity, int>
        where TEntity : class, IEntity<int>
    {
        protected SecondRepositoryBase(IDbContextProvider<SecondDbContext> dbContextProvider)
            : base(dbContextProvider)
        {

        }
    }
}

Do I create a custom repositories for the stored procedures as per your suggestion for each module that I have?

What I don't understand is in a AppService the IRepository<Entity> is in the constructor that injects the repository accordingly. I assume that this resolved correctly because of the IDbSet<Entity> within the 1st DbContext class.

How does this then work if I won't have a entity in the newly created 2nd DbContext class?

Excuse my ignorance, this is fairly new to me and I would really like to understand how everything fits together.

Answer

There is a bug on the level 4 menu.. I have corrected it now. Here is the updated code:

<div class="page-sidebar md-shadow-z-2-i  navbar-collapse collapse">
    
    
    
    
    
    
    <ul class="page-sidebar-menu" data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" ng-class="{'page-sidebar-menu-closed': settings.layout.pageSidebarClosed}" ng-if="vm.menu.items.length">
        
        <li ng-repeat="menuItem in vm.menu.items" ui-sref-active="active" ng-class="{'start':$first}">
            <a ui-sref="{{menuItem.url}}" ng-if="!menuItem.items.length">
                <i class="{{menuItem.icon}}"></i>
                <span class="title">{{menuItem.displayName}}</span>
            </a>
            <a href="javascript:;" class="auto" ng-if="menuItem.items.length">
                <i class="{{menuItem.icon}}"></i>
                <span class="title">{{menuItem.displayName}}</span>
                <span class="arrow "></span>
            </a>
            <ul class="sub-menu" ng-if="menuItem.items.length">
                
                <li ng-repeat="childMenuItem in menuItem.items" ui-sref-active="active" ng-class="{'start':$first}">

                    <a ui-sref="{{childMenuItem.url}}" ng-if="!childMenuItem.items.length">
                        <i class="{{childMenuItem.icon}}"></i>
                        <span class="title">{{childMenuItem.displayName}}</span>
                    </a>
                    <a href="javascript:;" class="auto" ng-if="childMenuItem.items.length">
                        <i class="{{childMenuItem.icon}}"></i>
                        <span class="title">{{childMenuItem.displayName}}</span>
                        <span class="arrow "></span>
                    </a>
                    <ul class="sub-menu" ng-if="childMenuItem.items.length">
                        
                        <li ng-repeat="childOfChildMenuItem in childMenuItem.items" ui-sref-active="active" ng-class="{'start':$first}">
                            <a ui-sref="{{childOfChildMenuItem.url}}" ng-if="!childOfChildMenuItem.items.length">
                                <i class="{{childOfChildMenuItem.icon}}"></i>
                                <span class="title">{{childOfChildMenuItem.displayName}}</span>
                            </a>
                            <a href="javascript:;" class="auto" ng-if="childOfChildMenuItem.items.length">
                                <i class="{{childOfChildMenuItem.icon}}"></i>
                                <span class="title">{{childOfChildMenuItem.displayName}}</span>
                                <span class="arrow "></span>
                            </a>
                            <ul class="sub-menu" ng-if="childOfChildMenuItem.items.length">
                                
                                <li ui-sref-active="active" ng-repeat="childOfChildOfChildMenuItem in childOfChildMenuItem.items">
                                    <a ui-sref="{{childOfChildOfChildMenuItem.url}}">
                                        <span>
                                            <i class="sub-menu-icon {{childOfChildOfChildMenuItem.icon}}"></i>{{childOfChildOfChildMenuItem.displayName}}
                                        </span>
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
            </ul>
        </li>
    </ul>
</div>
Answer

No problem, glad to be making a contribution :D

Answer

It would appear that the only change required was as I predicted. For anybody interested I will include the code changes that I have made:

<div class="page-sidebar md-shadow-z-2-i  navbar-collapse collapse">
    
    
    
    
    
    
    <ul class="page-sidebar-menu" data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" ng-class="{'page-sidebar-menu-closed': settings.layout.pageSidebarClosed}" ng-if="vm.menu.items.length">
        
        <li ng-repeat="menuItem in vm.menu.items" ui-sref-active="active" ng-class="{'start':$first}">
            <a ui-sref="{{menuItem.url}}" ng-if="!menuItem.items.length">
                <i class="{{menuItem.icon}}"></i>
                <span class="title">{{menuItem.displayName}}</span>
            </a>
            <a href="javascript:;" class="auto" ng-if="menuItem.items.length">
                <i class="{{menuItem.icon}}"></i>
                <span class="title">{{menuItem.displayName}}</span>
                <span class="arrow "></span>
            </a>
            <ul class="sub-menu" ng-if="menuItem.items.length">
                
                <li ng-repeat="childMenuItem in menuItem.items" ui-sref-active="active" ng-class="{'start':$first}">

                    <a ui-sref="{{childMenuItem.url}}" ng-if="!childMenuItem.items.length">
                        <i class="{{childMenuItem.icon}}"></i>
                        <span class="title">{{childMenuItem.displayName}}</span>
                    </a>
                    <a href="javascript:;" class="auto" ng-if="childMenuItem.items.length">
                        <i class="{{childMenuItem.icon}}"></i>
                        <span class="title">{{childMenuItem.displayName}}</span>
                        <span class="arrow "></span>
                    </a>
                    <ul class="sub-menu" ng-if="childMenuItem.items.length">
                        
                        <li ng-repeat="childOfChildMenuItem in childMenuItem.items" ui-sref-active="active" ng-class="{'start':$first}">
                            <a ui-sref="{{childOfChildMenuItem.url}}" ng-if="!childOfChildMenuItem.items.length">
                                <i class="{{childOfChildMenuItem.icon}}"></i>
                                <span class="title">{{childOfChildMenuItem.displayName}}</span>
                            </a>
                            <a href="javascript:;" class="auto" ng-if="childOfChildMenuItem.items.length">
                                <i class="{{childOfChildMenuItem.icon}}"></i>
                                <span class="title">{{childOfChildMenuItem.displayName}}</span>
                                <span class="arrow "></span>
                            </a>
                            <ul class="sub-menu" ng-if="childOfChildOfChildMenuItem.items.length">
                                
                                <li ui-sref-active="active" ng-repeat="childOfChildOfChildMenuItem in childOfChildMenuItem.items">
                                    <a ui-sref="{{childOfChildOfChildMenuItem.url}}">
                                        <span>
                                            <i class="sub-menu-icon {{childOfChildOfChildMenuItem.icon}}"></i>{{childOfChildOfChildMenuItem.displayName}}
                                        </span>
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
            </ul>
        </li>
    </ul>
</div>

Pardon the use of the incorrect terminology. Thank you very much for the help.

Showing 31 to 35 of 35 entries