Base solution for your next web application

Activities of "acrigney"

C:\Projects\Products\test\TrueAlliance.Products.Web.Tests\ProductsWebTestBase.cs(53,34): warning CS0114: 'ProductsWebTestBase.GetUrl<TController>(string)' hides inherited member 'AbpAspNetCoreIntegratedTestBase<Startup>.GetUrl<TController>(string)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. 6>C:\Projects\Products\test\TrueAlliance.Products.Web.Tests\ProductsWebTestBase.cs(58,34): warning CS0114: 'ProductsWebTestBase.GetUrl<TController>(string, object)' hides inherited member 'AbpAspNetCoreIntegratedTestBase<Startup>.GetUrl<TController>(string, object)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. 6> Compilation succeeded.>C:\Projects\Products\test\TrueAlliance.Products.Web.Tests\ProductsWebTestBase.cs(53,34): warning CS0114: 'ProductsWebTestBase.GetUrl<TController>(string)' hides inherited member 'AbpAspNetCoreIntegratedTestBase<Startup>.GetUrl<TController>(string)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. 6>C:\Projects\Products\test\TrueAlliance.Products.Web.Tests\ProductsWebTestBase.cs(58,34): warning CS0114: 'ProductsWebTestBase.GetUrl<TController>(string, object)' hides inherited member 'AbpAspNetCoreIntegratedTestBase<Startup>.GetUrl<TController>(string, object)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. 6> Compilation succeeded.

Sorry I had no problems when I was using Durandal before for my apps. But with Angular I also have this problem that the services can not be injected into the view models.i.e In the code below the abp.services.app.flight is not found. I get this error. Error: [ng:areq] <a class="postlink" href="http://errors.angularjs.org/1.5.6/ng/areq?p0=df.views.flight.list&p1=not%20a%20function%2C%20got%20undefined">http://errors.angularjs.org/1.5.6/ng/ar ... 0undefined</a>

(function () {

var controllerId = 'app.views.flight.list';
angular.module('app').controller(controllerId, [
    '$scope', 'abp.services.app.flight', 'abp.services.app.gate',    
function ($scope, flightService, gateService) {
    var vm = this;

    vm.localize = abp.localization.getSource('DailyFlights');

    vm.flights = [];
    vm.gates = [];

    vm.refreshGates = function () {                
        abp.ui.setBusy( 
            null,
            flightService.getGatesAsync().success(function(data) {
                vm.gates = data.gates;
            })
        );
    };

    vm.refreshGates();
        $scope.data = {
            selectedGate: null,
            availableGates: vm.gates
        };
        

        $scope.selectedGateId = 0;

        $scope.$watch('selectedGate', function(value) {
            vm.refreshFlights();
        });

        vm.refreshFlights = function () {                
            abp.ui.setBusy( //Set whole page busy until getFlights complete
                null,
                flightService.getFlightsAsync({ //Call application service method directly from javascript
                    AssignedGateId: $scope.selectedGateId > 0 ? $scope.selectedGateId : null,
                    FlightState: null
                }).success(function(data) {
                    vm.flights = data.flights;
                })
            );
        };

        vm.changeFlight = function(flight) {
            
            taskService.updateFlightAsync({
                flightId: flight.id,
                AssignedGateId: selectedGateId,
                ArrivalTime: newArrivalTime,
                DepartureTime: newDepartureTime
            }).success(function() {
                task.state = newState;
                abp.notify.info(vm.localize('FlightUpdatedMessage'));
            });
        };

        vm.getFlightCountText = function() {
            return abp.utils.formatString(vm.localize('XFlights'), vm.flights.length);
        };
    }
]);

})();

Please can you help me!

Best Regards, Alistair

Sorry I still don't see why <a class="postlink" href="http://localhost:6634/api/services/app/getFlightsAsync">http://localhost:6634/api/services/app/getFlightsAsync</a>

Doesn't work if I use

DynamicApiControllerBuilder .ForAll<IApplicationService>(typeof(DailyFlightsApplicationModule).Assembly, "app") .Build(); with public interface IFlightsAppService : IApplicationService { Task<GetFlightsOutput> GetFlightsAsync(GetFlightsInput input); Task UpdateFlightAsync(UpdateFlightInput input); Task CreateFlightAsync(CreateFlightInput input);

    GetFlightsOutput GetTest1();
}

Sorry for the delay on this.

When I try a GET on <a class="postlink" href="http://localhost:6634/api/services/app/flight/getTest1">http://localhost:6634/api/services/app/flight/getTest1</a>

I get No HTTP resource was found that matches the request URI 'http://localhost:6634/api/services/app/flight/getTest1'

And the same for my PUT 'http://localhost:6634/api/services/app/flight/GetFlightsAsync'." "message": "No HTTP resource was found that matches the request URI

And the dynamic controller in the WebAPI module is built like this DynamicApiControllerBuilder .ForAll<IApplicationService>(typeof(DailyFlightsApplicationModule).Assembly, "app") .Build(); Best Regards, Alistair

Hi Guys, Love your work again but I am not getting my dynamic web api services resolved in the angular controllers in my project. I have created a app from the templates with angular using module zero.

The task test app from the sample works and I am able to retrieve a response using postman

<a class="postlink" href="http://localhost:6247/api/services/tasksystem/task/getTasks">http://localhost:6247/api/services/task ... k/getTasks</a>

With a json body of

{ "AssignedPersonId":null, "State":null } My interface is

public async Task<GetFlightsOutput> GetFlightsAsync(GetFlightsInput input)

And so my web api should be available at <a class="postlink" href="http://localhost:6634/api/services/app/getFlightsAsync">http://localhost:6634/api/services/app/getFlightsAsync</a>

And I also created an interface on the app service with public GetFlightsOutput GetTest1()

but that is not being found either. the error is { "message": "No HTTP resource was found that matches the request URI 'http://localhost:6634/api/services/app/getTest1'." } i.e (using the camel casing)

I thought I should add an extension to DynamicApiControllerBuilder to see the list of methods just to be sure.

Is this something to do with module zero?

Best Regards, Alistair

Perhaps I could do an upgrade to EF7 it has support for InMemory databases with a nuget package and allows configuration of which type to use.

Hi Guys, Love your work! But I need to have a mock implementation of the database for the application just like you can with the base unit tests classes. I tested this out with your SimpleTaskSystem sample project.

I was wondering what you thought of this approach. I created a new project called SimpleTaskSystem.InMemoryData with a module SimpleTaskSystemInMemoryDataModule like this

using System.Reflection; using Abp.EntityFramework; using Abp.Modules; using Castle.MicroKernel.Registration; using System.Data.Common; using System; using SimpleTaskSystem.InMemoryData; using SimpleTaskSystem.EntityFramework;

namespace SimpleTaskSystem { [DependsOn(typeof(SimpleTaskSystemCoreModule), typeof(AbpEntityFrameworkModule))] public class SimpleTaskSystemInMemoryDataModule : AbpModule { public override void Initialize() { IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());

        IocManager.IocContainer.Register(
            Component.For&lt;SimpleTaskSystemDbContext&gt;()
                .Instance(SimpleTaskSystemInitialDataBuilder.Build(new SimpleTaskSystemDbContext(Effort.DbConnectionFactory.CreatePersistent("1"))))
                .IsDefault().Named("InMemoryData")                          
                .LifestyleSingleton()
            );
}

}

With a module class like this using System.Data.Entity.Migrations; using System.Linq; using SimpleTaskSystem.EntityFramework; using SimpleTaskSystem.People; using SimpleTaskSystem.Tasks;

namespace SimpleTaskSystem.InMemoryData { public static class SimpleTaskSystemInitialDataBuilder { public static SimpleTaskSystemDbContext Build(SimpleTaskSystemDbContext context) { //Add some people

        context.People.AddOrUpdate(
            p => p.Name,
            new Person {Name = "Isaac Asimov"},
            new Person {Name = "Thomas More"},
            new Person {Name = "George Orwell"},
            new Person {Name = "Douglas Adams"}
            );

        context.SaveChanges();

        //Add some tasks

        context.Tasks.AddOrUpdate(
            t => t.Description,
            new Task
            {
                Description = "my initial task 1"
            },
            new Task
            {
                Description = "my initial task 2",
                State = TaskState.Completed
            },
            new Task
            {
                Description = "my initial task 3",
                AssignedPerson = context.People.Single(p => p.Name == "Douglas Adams")
            },
            new Task
            {
                Description = "my initial task 4",
                AssignedPerson = context.People.Single(p => p.Name == "Isaac Asimov"),
                State = TaskState.Completed
            });

        context.SaveChanges();
        return (context);
    }
}

} And I just reference Effort and NMemory in the application. And change the data module to this module in the application. However when I want to switch back to testing with the Mock data at run time I would like to set the data dependent module at run time, so I can easily switch between the two if I have to. So how can I do a dynamic dependency?

Best Regards, Alistair

Question

Hi Guys, Love your work but we are unable to get our Azure reverse proxy setup to work. Its not a problem with ASP.NET Boilerplate its just a general MVC question. I just thought you could help us out 8-)

We have a root site xxx and the reverse proxy should redirect xxx/test to our real site <a class="postlink" href="http://blah.blah.azurewebsites.net">http://blah.blah.azurewebsites.net</a>

We have tried the fixes referenced here.

1 Fix for this now added to my AspNetBundling NuGet package which resolves a bunch of other issues in the standard transformer, particularly around using data-uris. Open-sourced on GitHub too.

Just do: 1.1 Install-Package AspNetBundling 1.2. Replace CssRewriteUrlTransform with CssRewriteUrlTransformFixed

  1. Using this CssRewriteUrlTransformWrapper public class CssRewriteUrlTransformWrapper : IItemTransform {
    public string Process(string includedVirtualPath, string input) { return new CssRewriteUrlTransform().Process("~" + VirtualPathUtility.ToAbsolute(includedVirtualPath), input); } }
  2. Using ResolveBundleUrl e.g with code like this <link href="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/content/styles/css")" rel="stylesheet" type="text/css" />

Here is our route rule in our root web.config file for our root site in Azure. NB. This site only has a web.config configured.

<rule name="test" stopProcessing="true"> <match url="^test/?(.*)" /> <action type="Rewrite" url="http://blah.blah.azurewebsites.net/{R:1}" /> </rule> But all of our scripts and js bundles give 404 not found errors.

It would be really awesome if you could give us any advice, we have Microsoft working on it!!

Best Regards, Alistair

Sorry the problem was that I was not getting the nuget restore to work properly in Visual Studio Team Services. If the packages folder is present OR Even if you have one pending to checkin (i.e not actually checked in) then nuget restore will not restore. And you should not have a Nuget.Targets file and packages.config in your .nuget folder.

I updated all of my projects to .net 4.6.1 and updated all packages to the latest code and its all working really great, thanks very much!!

Sorry mate I forgot to check that it just didn't come u[ when I ran this.

PM> Get-Package -ListAvailable -Filter Abp -AllVersions

Id Version Description/Release Notes


Abp 0.8.2.0 ASP.NET Boilerplate core package.
Abp.Application 0.3.2.0 IMPORTANT: This package is not used anymore. Use <a class="postlink" href="https://www.nuget.org..">https://www.nuget.org..</a>. Abp.AutoMapper 0.8.2.0 AutoMapper integration package for ASP.NET Boilerplate.
Abp.EntityFramework 0.8.2.0 EntityFramework integration package for ASP.NET Boilerplate.
Abp.FluentMigrator 0.8.2.0 FluentMigrator package for ASP.NET Boilerplate
Abp.HangFire 0.8.2.0 HangFire integration package for ASP.NET Boilerplate.
Abp.Infrastructure.EntityFr... 0.3.2.0 IMPORTANT: This package is not used anymore. Use <a class="postlink" href="https://www.nuget.org..">https://www.nuget.org..</a>. Abp.Infrastructure.NHibernate 0.3.2.0 IMPORTANT: This package is not used anymore. Use <a class="postlink" href="https://www.nuget.org..">https://www.nuget.org..</a>. Abp.Modules.Core 0.3.2.0 ASP.NET Boilerplate - Core Module
Abp.Modules.Core.Application 0.3.2.0 ASP.NET Boilerplate - Core Module - Application Layer
Abp.Modules.Core.Infrastruc... 0.3.2.0 ASP.NET Boilerplate - Core Module - Infrastructure - EntityFramework
Abp.Modules.Core.Infrastruc... 0.3.2.0 ASP.NET Boilerplate - Core Module - Infrastructure - NHibernate
Abp.Modules.Core.Web 0.3.2.0 ASP.NET Boilerplate - Core Module - Web Layer
Abp.Modules.Core.Web.Api 0.3.2.0 ASP.NET Boilerplate - Core Module - Web Api Layer
Abp.Modules.Core.Web.Mvc 0.3.2.0 ASP.NET Boilerplate - Core Module - MVC
Abp.NHibernate 0.8.2.0 NHibernate integration package for ASP.NET Boilerplate.
Abp.Owin 0.8.2.0 OWIN integration package for ASP.NET Boilerplate.
Abp.RedisCache 0.8.2.0 Redis Cache integration package for ASP.NET Boilerplate
Abp.Samples.Blog.Application 0.3.0.2 A sample blog module for ASP.NET Boilerplate.
Abp.Samples.Blog.Core 0.3.0.2 A sample blog module for ASP.NET Boilerplate.
Abp.Samples.Blog.EntityFram... 0.3.0.2 A sample blog module for ASP.NET Boilerplate.
Abp.Samples.Blog.Web 0.3.0.2 A sample blog module for ASP.NET Boilerplate.
Abp.TestBase 0.8.2.0 ASP.NET Boilerplate test base. Used to build unit/integration tests fo... Abp.Web 0.8.2.0 Web package for ASP.NET Boilerplate.
Abp.Web.Api 0.8.2.0 ASP.NET Web API integration package for ASP.NET Boilerplate.
Abp.Web.Api.OData 0.8.2.0 ASP.NET Web API - OData integration package for ASP.NET Boilerplate.
Abp.Web.Mvc 0.8.2.0 ASP.NET MVC integration package for ASP.NET Boilerplate.
Abp.Web.Resources 0.8.2.0 This package contains resources (xml, js and css files) needed for ASP... Abp.Web.SignalR 0.8.2.0 SignalR integration package for ASP.NET Boilerplate.
Abp.Zero 0.8.2.0 ASP.NET Boilerplate - Module Zero. Implements tenant, role, user and s... Abp.Zero.EntityFramework 0.8.2.0 ASP.NET Boilerplate - Module Zero - EntityFramework.
Abp.Zero.Ldap 0.8.2.0 ASP.NET Boilerplate - Module Zero - LDAP (Active Directory) Integration. Abp.Zero.NHibernate 0.8.2.0 ASP.NET Boilerplate - Module Zero - NHibernate Integration.
OneWork.AbpApplication 1.0.0.1 Description
OneWork.AbpWebMvc 1.0.0.2 Description

Showing 11 to 20 of 33 entries