Base solution for your next web application

Activities of "byteplatz"

Hello there

Am I missing somthing or AspNetZero v2 (core) does not have angular, only jquery ?

Is that correct?

Is that because of migration for angular v2 in next release ?

Bruno

Hello there,

I am using Abp for our NServiceBus Endpoint (Windows Service) and I need to configure the message handlers to work with multitenancy.

As far as I know, Abp uses AbpSession to retrieve TenantId for EntityFramework Dynamicfilter.

Since this service does not have logins, what would be the best way to deal with this when aI receive the message ?

  1. Create my own implementation for IAbpSession and register it as transient (thus being created for every message received) ?
  • Using this approach I can set TenantId and UserId into the session because the received message contains TenantId and UserId (headers). This way, EntityFramework dynamic filter will work transparently ?
  1. Just set the PropertyFilter (EF DynamicFilter) values when the message arrives ? This way the DB-part of the multitenancy side is solved, but we may hit other issues with Session being null ?

Appreciate your suggestions

Bruno

Thanks a lot Halil,

I will try your suggested solution

Thanks again

Bruno

Thank you Halil.

I will try to reproduce the test and let you know

Bruno

Hello guys,

I am having issues frequently when trying to debug an AspNetZero project.

We are using VS2015 and latest version of AspNetZero.

First time we debug the solution using F5 everything works normal. Then we stop debugging and make some code changes in order to fix/add something. We hit F5 again and the debugger starts, browser opens and the output window is filled with information until we can see the messages generating DynamicProxyGenAssembly2 (Castle proxies) and it stays there forever. Browser keeps loading (spinning wheel) and debug output shows nothing. No exception at all (even marking all exceptions to be break into in ExceptionSettings).

I don't know what else to investigate.

Does anyone have the same issue ?

Does anyone uses VS2015 with Abp and debug / stop / change code / debug again and it works normal ?

I'm using IIS Express. The only thing left for tests is to use normal IIS instead of express...

Thanks a lot and hope someone can help me out with this.

Bruno

The issue here is :

If I resolve ILocalizationManager inside test class constructor = its not registered.

If I resolve inside a [Fact] it works

Is this expected behavior ?

BRuno

Hello there,

I was wondering why ILocalizationManager does not get injected in custom classes (not appservice and alike) when using the Test infrastructure (extending from AbpIntegratedTestBase).

Is this expected behavior ?

If so, how can I make the ILocalizationManager to be registered in Test infrastructure?

Bruno

Hello Halil,

First of all, sorry for the long post, but Im stuck with this.

Im trying to use Abp infrastructure inside a NServiceBus Endpoint and I am having problems with unitofwork.

NServiceBus handle its own transaction and unitofwork when consuming a message and invoking a given handler. (<a class="postlink" href="http://docs.particular.net/nservicebus/pipeline/unit-of-work">http://docs.particular.net/nservicebus/ ... it-of-work</a>)

Inside this handler I am injecting few repositories. Think the Handler as more like a appservice triggered by a message received.

The problem is I cant get control over Abp unitofwork to be able to complete the transaction only after nservicebus has finished working with the message.

The approaches suggested in documentation (<a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Unit-Of-Work">http://aspnetboilerplate.com/Pages/Docu ... it-Of-Work</a>) did not work for this specific case.

I really need your help to move forward.

This is the handler code which is instantiated by NServiceBus when a new message is received:

public class CreditGenerationApprovalHandler : IHandleMessages<ApproveCreditGeneration>
    {
        public IBus Bus { get; set; }

        public IRepository<Credit, Guid> CreditRepository { get; set; }

        public void Handle(ApproveCreditGeneration message)
        {
            Credit credit = CreditRepository.Get(message.CreditId.Value);
            credit.Approve();

            Bus.Publish<CreditGenerationApproved>(evt =>
            {
                evt.CreditId = credit.Id;
                evt.CreditValue = credit.Value;
            });
        }
    }

I have integrated the IoC and bootstrapped Abp like this (this is called by NServiceBus upon initialization):

public class AbpBootstrap : INeedInitialization
    {
        public void Customize(BusConfiguration configuration)
        {
            // Initialize Abp infrastructure
            var bootstrapper = new AbpBootstrapper();
            bootstrapper.IocManager.IocContainer.AddFacility<LoggingFacility>(f => f.UseLog4Net().WithConfig(ITSConsts.Log4NetConfigFile));
            bootstrapper.Initialize();
        }
    }

NServiceBus IoC is using Abp Windsor:

// Retrieves current IocContainer from Abp
var container = IocManager.Instance.IocContainer;

// Configure Container into NServiceBus
configuration.UseContainer<WindsorBuilder>(c => c.ExistingContainer(container));

If I don't configure anything, the transaction is aborted at the following method (which is what the documentation states, the method is atomic, it completes the transaction right after its execution):

Credit credit = CreditRepository.Get(message.CreditId.Value);

I cannot work that way because I need to perform other tarnsactional operations like Bus.Publish (MSMQ transactional queue).

If I decorate the Handle method with [UnitOfWork] the handler is not able to call it (can't figure why).

Another approach I have tried is using the IManageUnitsOfWork control for NServiceBus (which I believe I should disable Unitofwork at the handle method) and let NSB control it like :

public class EfUnitOfWorkManager : IManageUnitsOfWork, INeedInitialization
    {
        public ILogger Logger { get; set; }

        public IUnitOfWorkManager UowManager { get; set; }

        private IUnitOfWorkCompleteHandle _unitOfWork;

        public void Customize(BusConfiguration configuration)
        {
            configuration.RegisterComponents(config =>
            {
                config.ConfigureComponent<EfUnitOfWorkManager>(DependencyLifecycle.InstancePerCall);
            });
        }

        public void Begin()
        {
            Logger.Debug("NsbUnitOfWorkManager started.");
            _unitOfWork = UowManager.Begin();
        }

        public void End(Exception ex = null)
        {
            if (ex == null)
            {
                Logger.Debug("NsbUnitOfWorkManager completed.");
                UowManager.Current.SaveChanges();
            }
            else
            {
                Logger.Error("NsbUnitOfWorkManager failed.", ex);
            }
        }
    }

Are there any possibilities to disable the commit trnsaction and let me do it manually like mentioned above at the End method called by NServiceBus ?

Many thanks in advance

Bruno

Is this OOB for Abp ?

I could not find anything ready to use with signalR.

Do we need to implement the resolver/install signalr nuget manually ? Or does abp have something ready ?

Bruno

Actually it's domain based not port based...

We manages it to work with different ports and same cookie name

Legacy and new coexisting now

Kind regards

Bruno

Showing 1 to 10 of 57 entries