Base solution for your next web application

Activities of "doubledp"

Question

I am going to use ASP.NET Zero framework for internal web based system and don't see much use for the landing page, would rather it go to web app upon start up.

What would be the best way to achieve this without modifying the current structure of the framework? I want to try and stick as much as possible to the way things are done in this framework, as I think it exceptional coding (hopefully I can code like that in a couple of years). Also it would make upgrading the code with new releases fairly pain free.

Is there any pitfalls with this approach?

Question

How many levels of navigation is supported? It would appear that I can only dive 1 level.

The AppPermissionsProvider seems to cater for multi levels as they appear in the treemenu as defined in the code, but from the HTML point of view, it does not reflect the multi menu correctly as defined in the AppNavigationProvider.

I had a look at the Metronic demo and it does seem like you can dive 3 levels.

Is it just a case of amending the sidebar.cshtml in App\common\views\layout.cshtml?

Could anyone provide some guidance on the best way to add a javascript library such as amCharts. Is this a manual process or do you do this through NuGet?

The steps to get this to work would seem to be: Download library, manually add script and css files to solution/Install library through NuGet Include script in ScriptPaths under App_Start/Bundling Include css in StylePaths under App_Start/Bundling Include dependency in app.js

Ideally I would like to be able to auto update these libraries when added, can you please direct me in applying best practice and how to achieve that?

I know that this question of at least a similar question has been asked before. I would like a little more clarity regarding this.

I will have 2 dbContext, 1 connecting to the LOB database and another connecting to a DW database. I have written stored procedures that aggregates data and is returned within the result set.

I would very much like to use entity framework to handle this for me, but I do not want import the tables within that database as I won't be using them directly. My guess is that I need to create entities that will be mapped to the result set of each stored procedure. Would this not create these entities as tables in the database? (This is not what I want)

I am a bit confused as to how to handle this, because I want the dynamic WebAPI functionality to still work and for the functionality to remain very similar as how things are currently being done.

Any guidance will be much appreciated.

Hi Halil,

I desperately need you help. As per my previous post [http://forum.aspnetboilerplate.com/viewtopic.php?f=5&t=580]), I am sure you realize that I am doing some sort of dashboard tool. I am pleased to announce that I can now retrieve the data successfully via SP with it still fitting into the way you are doing things within ASP.NET Zero.

A requirement has now been added that users should only see data as configured. Changing the SP is no problem as I just parameterized it.

What I would like to achieve is something very similar to how the roles are configured.

The database that I am working with via the SPs has consolidated data and unique result sets is identified via a module code, company code and a location.

This is what I have done so far: I have created a static list of modules names, very much the same as you have done with the static role names. I have created the basic application logic, presentation logic, domain logic for company, branches and locations, to dynamically add to them as needed

The idea behind branches is to allow the admin to setup a list with module and company combinations. (Similar to how the features work). This branch in turn is used as a selection within the location setup that the inherits the list of modules/company combinations, which is up for manipulation. (Similar to how the user defined permissions work). Finally multiple locations can then be added to the user, which inherits all of the modules/company combinations.

My thinking is that if things are done in this way, I would be able to access this setup in the same way I would access the other user information. Am I right in thinking that?

I have tried to look at how you do things but there are some places where I get lost. For example how does the static list of permissions get read for use within the permissionManager.

Please you expert guidance will be much appreciated. If you can please point me in the right direction and tell me what to look out for, what should be affected for this to slot into the ASP.NET Zero.

Question

Hi,

When calling GetCurrentUser defined within ApplicationServiceBase from my application service that inherits from my ApplicationServiceBase it fails as all AbpSession properties is null.

appService.user is set correctly in the client side code within the AngularJS controller.

Need help urgently please!

Hi,

I would like to know if it is possible for dependency injection to work in the ApplicationService, if one would implement generics within the custom repository?

Something like this...

Custom repository interface:

public interface ICustomRepository<TEntity> : IRepository<TEntity, int>, ITransientDependency
        where TEntity : class, IEntity<int>
    {
        List<TEntity> GetRepositoryList();
    }

Custom repository:

public class CustomRepository<TEntity> : ApplicationRepositoryBase<TEntity>, ICustomRepository<TEntity>
        where TEntity : class, IEntity<int>
    {
        public CustomRepository(IDbContextProvider<ApplicationDbContext> dbContextProvider)
            : base(dbContextProvider)
        {

        }

        public List<TEntity> GetRepositoryList()
        {

        }
    }
}

Custom application service:

public class CustomAppService : CaerusAppServiceBase, ICustomAppService
    {
        private readonly ICustomRepository<CustomEntity> _customEntityRepository;
        
        public CustomAppService (ICustomRepository<CustomEntity> customEntityRepository)
        {
            _customEntityRepository = customEntityRepository;
        }
}

Hi,

In the documentation regarding the Dynamic Web API layer, there is the mention of the following:

ITaskAppService is the application service that we want to wrap with an api controller. It is not restricted to application services but this is the traditional and recommended way. "tasksystem/task" is name of the api controller with an arbitrary namespace. You should define at least one-level namespace but you can define more deep namespaces like "myCompany/myApplication/myNamespace1/myNamespace2/myServiceName". '/api/services/' is a prefix for all dynamic web api controllers. So, address of the api controller will be like '/api/services/tasksystem/task' and GetTasks method's address will be '/api/services/tasksystem/task/getTasks'. Method names are converted to camelCase since it's conventional in javascript world.

Does that mean we should explicitly define every application service like the following, if we want it generate the APIs according to the namespace of where the interface is defined?

DynamicApiControllerBuilder.For<ITaskAppService>("/myNamespace1/myNamespace2/tasksystem/task").Build();

Or is there perhaps a more dynamic way of generating it as above? The reason I am asking is because I see that currently in the template's WebAPI assembly, the initialization is defined as follows:

DynamicApiControllerBuilder
                .ForAll<IApplicationService>(typeof(TemplateApplicationModule).Assembly, "app")
                .Build();

Hi,

It seems like I might have broken something during the upgrade. I went from version 1.5.0.0 to 1.7.0.0 (Quite a painful exercise I might add).

The problem I am experiencing now is that sidebar navigation does not expand when clicking on it. I have inspected the element that should contain items and the rendered HTML does contain those items, but the expansion does not happen.

Any ideas what the problem might be?

Hi,

Could you please help me with the following:

I am trying to execute async calls is parallel and only use execute subsequent code after all the async tasks have been completed.

Here is the code:

public async Task<LabourSalesHighlightsDto> GetLabourSalesHighlights(LabourSalesAggregateInput input)
        {
            LabourSalesHighlightsDto labourSalesHighlights = new LabourSalesHighlightsDto();

            var labourSalesOperatorAggregateTask = GetLabourSalesAggregation_ByCompanyNumber_ByOperatorName(input);
            var labourSalesInvoicingAggregateTask = GetLabourSalesAggregation_ByCompanyNumber_ByInvoicing(input);
            var labourSalesCreditingAggregateTask = GetLabourSalesAggregation_ByCompanyNumber_ByCredits(input);

            await Task.WhenAll(labourSalesOperatorAggregateTask, labourSalesInvoicingAggregateTask, labourSalesCreditingAggregateTask);

            var labourSalesOperatorAggregate = labourSalesOperatorAggregateTask.Result;
            var labourSalesInvoicingAggregate = labourSalesInvoicingAggregateTask.Result;
            var labourSalesCreditingAggregate = labourSalesCreditingAggregateTask.Result;

            labourSalesHighlights.SalesTopTotal = labourSalesOperatorAggregate.Items.Select(lsa => lsa.Value).FirstOrDefault();
            labourSalesHighlights.SalesTopName = labourSalesOperatorAggregate.Items.Select(lsa => lsa.Label).FirstOrDefault();
            labourSalesHighlights.SalesTopDescription = labourSalesOperatorAggregate.Items.Select(lsa => lsa.CompanyName).FirstOrDefault();

            labourSalesHighlights.InvoicingTotal = labourSalesInvoicingAggregate.Items.Select(lsa => lsa.Value).Sum();
            labourSalesHighlights.InvoicingBestName = labourSalesInvoicingAggregate.Items.Select(lsa => lsa.Label).FirstOrDefault();
            labourSalesHighlights.InvoicingWorstName = labourSalesInvoicingAggregate.Items.Select(lsa => lsa.Label).LastOrDefault();

            labourSalesHighlights.CreditingTotal = labourSalesCreditingAggregate.Items.Select(lsa => lsa.Value).Sum();
            labourSalesHighlights.CreditingBestName = labourSalesCreditingAggregate.Items.Select(lsa => lsa.Label).FirstOrDefault();
            labourSalesHighlights.CreditingWorstName = labourSalesCreditingAggregate.Items.Select(lsa => lsa.Label).LastOrDefault();

            return labourSalesHighlights;
        }

When I don't inherit from AppServiceBase for this particular service, the code is working with the only exception that the audit log entry does not get created then.

When I inherit from AppServiceBase for this particular service, the execution of the above method results in an exception as per below:

System.NotSupportedException: A second operation started on this context before a previous asynchronous operation completed. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context. Any instance members are not guaranteed to be thread safe.

I want to inherit from AppServiceBase so that my method call gets logged to the Audit Log table.

Please help!

Showing 1 to 10 of 15 entries