Browse Source

Added AbpViewComponent and fixed Dockerfile for .netcoreapp 2.0.

pull/113/head
Halil İbrahim Kalkan 9 years ago
parent
commit
d8e4b9c9ee
  1. 13
      src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs
  2. 2
      src/AbpDesk/AbpDesk.Web.Mvc/Dockerfile
  3. 2
      src/Volo.Abp.AspNetCore.Mvc.UI/Views/Shared/Components/AbpMenu/AbpMenuViewComponent.cs
  4. 2
      src/Volo.Abp.AspNetCore.Mvc.UI/Views/Shared/Components/AbpScriptBundle/AbpStyleBundleViewComponent.cs
  5. 2
      src/Volo.Abp.AspNetCore.Mvc.UI/Views/Shared/Components/AbpStyleBundle/AbpStyleBundleViewComponent.cs
  6. 2
      src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs
  7. 9
      src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpViewComponent.cs

13
src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs

@ -1,4 +1,5 @@
using AbpDesk.EntityFrameworkCore; using System;
using AbpDesk.EntityFrameworkCore;
using AbpDesk.Web.Mvc.Navigation; using AbpDesk.Web.Mvc.Navigation;
using AbpDesk.Web.Mvc.Temp; using AbpDesk.Web.Mvc.Temp;
using Autofac; using Autofac;
@ -9,11 +10,13 @@ using Microsoft.Extensions.DependencyInjection;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.EmbeddedFiles; using Volo.Abp.AspNetCore.EmbeddedFiles;
using Volo.Abp.AspNetCore.Modularity; using Volo.Abp.AspNetCore.Modularity;
using Volo.Abp.AspNetCore.Mvc.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
using Volo.Abp.Identity; using Volo.Abp.Identity;
using Volo.Abp.Identity.Web; using Volo.Abp.Identity.Web;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Timing;
using Volo.Abp.Ui.Navigation; using Volo.Abp.Ui.Navigation;
namespace AbpDesk.Web.Mvc namespace AbpDesk.Web.Mvc
@ -48,6 +51,14 @@ namespace AbpDesk.Web.Mvc
services.AddAssemblyOf<AbpDeskWebMvcModule>(); services.AddAssemblyOf<AbpDeskWebMvcModule>();
services.GetContainerBuilder().RegisterType<MyClassToTestAutofacCustomRegistration>(); services.GetContainerBuilder().RegisterType<MyClassToTestAutofacCustomRegistration>();
services.Configure<BundlingOptions>(options =>
{
options.ScriptBundles.Add("GlobalScripts", new[]
{
"/AbpServiceProxies/GetAll?_v=" + DateTime.Now.Ticks
});
});
} }
public override void OnApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)

2
src/AbpDesk/AbpDesk.Web.Mvc/Dockerfile

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore FROM microsoft/aspnetcore:2.0
WORKDIR /app WORKDIR /app
COPY . . COPY . .

2
src/Volo.Abp.AspNetCore.Mvc.UI/Views/Shared/Components/AbpMenu/AbpMenuViewComponent.cs

@ -4,7 +4,7 @@ using Volo.Abp.Ui.Navigation;
namespace Volo.Abp.AspNetCore.Mvc.Views.Shared.Components.AbpMenu namespace Volo.Abp.AspNetCore.Mvc.Views.Shared.Components.AbpMenu
{ {
public class AbpMenuViewComponent : ViewComponent public class AbpMenuViewComponent : AbpViewComponent
{ {
private readonly IMenuManager _menuManager; private readonly IMenuManager _menuManager;

2
src/Volo.Abp.AspNetCore.Mvc.UI/Views/Shared/Components/AbpScriptBundle/AbpStyleBundleViewComponent.cs

@ -3,7 +3,7 @@ using Volo.Abp.AspNetCore.Mvc.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.Views.Shared.Components.AbpScriptBundle namespace Volo.Abp.AspNetCore.Mvc.Views.Shared.Components.AbpScriptBundle
{ {
public class AbpScriptBundleViewComponent : ViewComponent public class AbpScriptBundleViewComponent : AbpViewComponent
{ {
private readonly IBundleManager _bundleManager; private readonly IBundleManager _bundleManager;

2
src/Volo.Abp.AspNetCore.Mvc.UI/Views/Shared/Components/AbpStyleBundle/AbpStyleBundleViewComponent.cs

@ -3,7 +3,7 @@ using Volo.Abp.AspNetCore.Mvc.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.Views.Shared.Components.AbpStyleBundle namespace Volo.Abp.AspNetCore.Mvc.Views.Shared.Components.AbpStyleBundle
{ {
public class AbpStyleBundleViewComponent : ViewComponent public class AbpStyleBundleViewComponent : AbpViewComponent
{ {
private readonly IBundleManager _bundleManager; private readonly IBundleManager _bundleManager;

2
src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs

@ -45,7 +45,7 @@ namespace Volo.Abp.AspNetCore.Mvc
public override void PostConfigureServices(IServiceCollection services) public override void PostConfigureServices(IServiceCollection services)
{ {
//TODO: Consider to use services.AddMvc() and move this to ConfigureServices method! //TODO: Consider to use services.AddMvc() and move this to ConfigureServices method! And also use .AddControllersAsServices and .AddViewComponentsAsServices...
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>(); services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.TryAddSingleton<IActionContextAccessor, ActionContextAccessor>(); services.TryAddSingleton<IActionContextAccessor, ActionContextAccessor>();

9
src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpViewComponent.cs

@ -0,0 +1,9 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Mvc
{
public abstract class AbpViewComponent : ViewComponent, ITransientDependency
{
}
}
Loading…
Cancel
Save