Base solution for your next web application
Open Closed

ELSA Integration MVC #11822


User avatar
0
gryphon644 created

Hi, I'm facing an issue while integrating Elsa following the blog tutorial https://docs.aspnetzero.com/en/aspnet-core-mvc/latest/Core-Mvc-Elsa-Integration Issue : .UseEntityFrameworkPersistence and .UseAutoMapper are not being resolved even though I installed all the needed nuggets.

I've looked around but still can't find the reason.

Would Appreciate any help


7 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    This document is outdated, could you follow https://aspnetzero.com/blog/integrating-elsa-with-asp.net-zero ?

    Thanks,

  • User Avatar
    0
    gryphon644 created

    I followed this blog post but still can't resolve the issue. Added all these packages

    Here is my error

    Error CS1061 : 'IModule' does not contain a definition for 'UseEntityFrameworkCorePersistence' and no accessible extension method 'UseEntityFrameworkCorePersistence' accepting a first argument of type 'IModule' could be found (are you missing a using directive or an assembly reference?)

    And here are my assembly references and implementation

    using Elsa;
    using Elsa.Server.Api;
    using Elsa.Persistence.EntityFramework.SqlServer;
    using Elsa.Persistence.EntityFramework.Core.Extensions;
    using Microsoft.EntityFrameworkCore;
    
    private void ConfigureElsa(IServiceCollection services)
    		{
    			services
    				.AddElsa(elsa => elsa
    					.UseEntityFrameworkCorePersistence(ef =>
    						ef.UseSqlServer(_appConfiguration.GetConnectionString("Default")))
    					.AddConsoleActivities()
    					.AddHttpActivities(options => _appConfiguration.GetSection("Elsa:Server").Bind(options))
    					.AddQuartzTemporalActivities()
    					.AddJavaScriptActivities()
    					.AddWorkflow<Startup>());
    
    
    
    			// Elsa API endpoints.
    			services.AddElsaApiEndpoints();
    			services.Configure<ApiVersioningOptions>(options => { options.UseApiBehavior = false; });
    
    			services.Configure<RouteOptions>(options => { options.LowercaseUrls = false; });
    
    			// For Elsa Dashboard.
    			services.AddRazorPages();
    
    			// Remove ABP filter and add Elsa special filter
    			services.PostConfigure<MvcOptions>(ReplaceResultFilter);
    		}
    
    

    Can I be sure that the implementation from the blog is not up to date? Does it still work for Elsa v3?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Could you take a look at the sample our team prepared https://github.com/aspnetzero/aspnet-zero-samples/tree/master/ElsaMvcDemo ?

  • User Avatar
    0
    gryphon644 created

    Yeah thanks!

  • User Avatar
    0
    gryphon644 created

    I see now what happened! This implementation would only work with Elsa 2. The moment I upgraded the Elsa package I ran to the same issue.

    Are you guys planning on updating the docs to Elsa 3 implementation?

  • User Avatar
    0
    devpartners created

    I second this question; Elsa 3.x integrated example project will help a great deal.

  • User Avatar
    0
    lschelvan created

    Can you also put together an Elsa 3.0 example for Angular?