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

Activities of "BobIngham"

@alper, yeah, I kind of thought that would be the case. I will think on it for a while. Nice entry in the wiki for AbpSession by the way. keep it up. Volosoft should really implement a Medium account for us to submit things like this to.

Did I see a discussion somewhere here or in github (I have searched both) with regard to entities belonging to multiple OrganizationUnits? If so, could someone point me to it? Given the interfaces IMayHaveOrganizationUnit/IMustHaveOrganizationUnit how does one go about implementing such a pattern? Are there any guidelines anywhere?

Answer

That's taken me one step backwards, now there are no entity history records at all. I think the only thing to do here is for me to build a base Zero aspnet-core project and import a text file using this code, fired from Hangfire and then we can take a look again. At the moment I get the feeling we are applying hacks and not knowing why it is not working. For example, why would the .Current in _unitOfWorkManager.Current.SaveChanges(); return null?

Answer

_unitOfWorkManager.Current.SaveChanges() throws a null error on .Current. I am kind of tearing my hair out with this one but entity history does not form a part of what I need to move the system to trial next week. I will put this on one side and come back to it. In the meantime I have attached my DataProvider class, the method "UpdateFromDataProvider" is called direct from Hangfire from the following worker class:

using Abp.BackgroundJobs;
using Abp.Configuration;
using Abp.Dependency;
using Abp.Domain.Repositories;
using Nuagecare.App.Services;
using Nuagecare.MultiTenancy;
using System.Linq;

namespace Nuagecare.Web.Hangfire.Workers
{
    public class UpdateFromDataProvider : BackgroundJob<int>, ITransientDependency
    {
        private readonly ITenantAppService _tenantService;
        private readonly IRepository<Tenant> _tenantRepository;
        private readonly SettingManager _settingManager;
        private readonly DataProviderAPIProvider _dataProviderAPIProvider;

        public UpdateFromDataProvider(
            ITenantAppService tenantService,
            IRepository<Tenant> tenantRepository,
            SettingManager settingManager,
            DataProviderAPIProvider dataProviderAPIProvider)
        {
            _tenantService = tenantService;
            _tenantRepository = tenantRepository;
            _settingManager = settingManager;
            _dataProviderAPIProvider = dataProviderAPIProvider;
        }

        public override void Execute(int number)
        {
            var tenants = _tenantRepository.GetAllList()
                .Where(t => t.IsActive == true);

            foreach (var tenant in tenants)
            {
                _dataProviderAPIProvider.UpdateFromDataProvider(tenant.Id);
            }
            return;
        }
    }
}

I am hoping you can throw some light on why I am getting a row in each of AbpEntityChangeSets and AbpEntityChanges but nothing in AbpEntityPropertyChanges.

Cheers, Bob

[attachment=0:3cw44pfw]DataProviderAPIProvider.zip[/attachment:3cw44pfw] DataProviderAPIProvider.zip

Hi Aaron, I confess to not having tried that. I am working on other stuff right now and because this is not critical I will come back to you after I finish my planned release and get back to you. Thanks for your help so far.

Hi Aaron, this is traight from 5.4.1 download:

namespace Nuagecare.Tests
{
    [DependsOn(
        typeof(NuagecareApplicationModule),
        typeof(NuagecareEntityFrameworkCoreModule),
        typeof(AbpTestBaseModule))]
    public class NuagecareTestModule : AbpModule
    {

Hi Aaaron, Thanks for the help. From debugging:

at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy)\r\n   at Castle.MicroKernel.DefaultKernel.Resolve(Type service, IDictionary arguments)\r\n   at Castle.Windsor.WindsorContainer.Resolve[T]()\r\n   at Abp.Dependency.IocManager.Resolve[T]()\r\n   at Abp.Dependency.IocResolverExtensions.ResolveAsDisposable[T](IIocResolver iocResolver)\r\n   at Nuagecare.Migrations.Seed.Host.App.DefaultOrganizationUnitCreator.Create()\r\n   at Nuagecare.Migrations.Seed.Host.InitialHostDbBuilder.Create()\r\n   at Nuagecare.Migrations.Seed.SeedHelper.SeedHostDb(NuagecareDbContext context)\r\n   at Nuagecare.Migrations.Seed.SeedHelper.WithDbContext[TDbContext](IIocResolver iocResolver, Action`1 contextAction)\r\n   at Nuagecare.Migrations.Seed.SeedHelper.SeedHostDb(IIocResolver iocResolver)\r\n   at Nuagecare.EntityFrameworkCore.NuagecareEntityFrameworkCoreModule.PostInitialize()\r\n   at Abp.Modules.AbpModuleManager.&lt;&gt;c.&lt;StartModules&gt;b__15_2(AbpModuleInfo module)\r\n   at System.Collections.Generic.List`1.ForEach(Action`1 action)\r\n   at Abp.Modules.AbpModuleManager.StartModules()\r\n   at Abp.AbpBootstrapper.Initialize()

From the test explorer: [attachment=0:1d49vu01]TestProblem.PNG[/attachment:1d49vu01] Again, thanks for your help.

Question

Hi guys, I ran all tests and almost all failed with the message "Message: Castle.MicroKernel.ComponentNotFoundException : No component for supporting the service Abp.Organizations.OrganizationUnitManager was found". It's a while since I ran tests so I'm not sure what's changed, I was fully expecting some to fail due to changes I have made to core Zero code but this seems to be an entirely different problem. Can anyone point me in the right direction? I am not fully conversant with how the Tests project is put together and in the past I have simply run it and then modified tests to reflect changes to core code and new tests for my own code. Can anyone point me in the right direction?

Answer

@alper, thanks for that, I can live with null values in the AbpEntityChangeSets.BrowserInfo, ClientIpAddress and ClientName columns. But it still doesn't answer why I have no persistence in the AbpEntityPropertyChanges table. @aaron - any ideas how to address this?

Answer

Hi Aaron, I tried exactly as you said and a couple of other things to no avail. However, on closer inspection I noticed your entity history tables were full of non-nullable UserId's. I changed this line to force UserId = 1 as the standard host admin:

using (_abpSession.Use(tenantId, 1))
{...

<ins>AbpEntityChangeSets</ins> That now gives me a record in AbpEntityChangeSets with a null value in BrowserInfo, ClientIpAddress, _ClientName_and Reason(as can be expected). I think I should be able to populate the Reason column using IEntityChangeSetReasonProvider, I'm not sure how I could insert values for ClientIpAddress and ClientName, which could be useful. <ins>AbpEntityChanges</ins> I have a full set of data in AbpEntityChanges which is great. <ins>AbpEntityPropertyChanges</ins> Herein lies the problem. The AbpEntityPropertyChanges has not been populated at all which kind of makes the other two entries pointless in that we know something has changed but we don't know what.

Can you help me track the problem a little bit further? Sorry to be a pain but hopefully the above should give a few pointers?

Showing 491 to 500 of 619 entries