Base solution for your next web application

Activities of "byteplatz"

By removing the EntityChangedEventData handler it Works fine.

My understanding for this behavior (listening both parente/child event when inheriting) this will be the flow:

The lower level event handler get called, in this case it should be EntityCreatedEventHandler....then, because of the inheritance, EntityChangedEventHandler...

But the EntityCreatedEventHandler is called twice...

Thoughts Halil ?

Bruno

I have opened an issue on GitHub regarding transaction and UoW on EventBus when using 02 dbcontexts (from separated module)

[https://github.com/aspnetzero/aspnet-zero/issues/85])

I need this in a certain level of priority. If you could take a look I would greatly appreciate.

Bruno

Hello Halil,

Im testing the migration path we will use for our application. For a while, we will need to have both (legacy MVC and new AspNetZero Mvc) workin in parallel.

I would like to setup Owin shared cookie between AspNetZero and legacy MVC but I need to understand few things from your side.

If you create a solution with 02 different web projects (called Web1 and Web2) and leave the defaults for OWIN, both apps share same cookie authentication: if you decorate with [Authorize] and create user in Web1 then access Web2, Web2 will allow the request even if the user does not exists there. Thats okay and expected behavior (the cookie name are the same and the machine are the same as well).

This scenario creates (by using google chrome) one cookie "LocalStorage" for each webapp:

http://localhost:58830 - Web1
http://localhost:58831 - Web2

So far so good. This behavior is what Im trying to setup between AspNetZero and my legacy MVC app.

Now, from AspNetZero: When I start google chrome and navigate to aspnetzero home page (no logged in user yet) it does not create the "localstorage" cookie (like Web1 and Web2). Instead it creates the ASP.Net_SessionId and VerificationToken...

Thats okay for me...

But Im trying to understant what should I need to do to "SHARE" AspNetZero Cookie with Web1 and Web2. I've tried to set the same cookie name for all 3 apps but that didn't work.

I believe is something related to session or something.

Do you have any customization on owin/katana/session (besides AbpSession) that manage to change cookies ?

Can you help me on this issue ?

Bruno

I would avoid windows authentication (its not designed for SSO). Instead you should use WS-Federation External Auth (It works fine with Abp, we have it in place).

Then you can use either AzureAD + Sync with your internal AD OR Install ADFS (Active Directory Federated Services) and use Abp with OWIN/External Auth WS-Federation ...

This is the standard for the SSO on windows

Bruno

One more catch, if you use WS-Federation + ADFS (or AzureAD) you don't need LDAP Auth. ADFS does that for you

Bruno

Hello Halil, how are you ?

I was wondering if is possible for you to share the MultiProjectTemplate used to create AspNetZero solutions. I ask because we need to develop several separated modules and this is a tedious task.

I think youre using SideWaffle (as I saw question from someone using this to help you to create the multiproject template).

My intention is to customize this template for new module: File\NewProject\MyServiceModule and this will create the infrastructure needed (core, app, etc)

Thanks in advance

Bruno

We are using azure ad through wsfederation and it's working fine for quite a while...

We also made it work with on premises adfs...

It's basically simple in the code view...

You just need to authorize he app on azuread and configure abp basically with few options

I will take a look at your pr

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

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

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

Showing 41 to 50 of 57 entries