mirror of https://github.com/abpframework/abp.git
10 changed files with 118 additions and 17 deletions
@ -0,0 +1,14 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace AbpDesk |
|||
{ |
|||
[DependsOn(typeof(AbpDeskDomainModule))] |
|||
public class AbpDeskApplicationModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddAssemblyOf<AbpDeskApplicationModule>(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using AbpDesk.EntityFrameworkCore; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace AbpDesk.ConsoleDemo |
|||
{ |
|||
[DependsOn(typeof(AbpDeskApplicationModule), typeof(AbpDeskEntityFrameworkCoreModule))] |
|||
public class AbpDeskConsoleDemoModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddAssemblyOf<AbpDeskConsoleDemoModule>(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using System; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp; |
|||
|
|||
namespace AbpDesk.ConsoleDemo |
|||
{ |
|||
public class Program |
|||
{ |
|||
public static void Main(string[] args) |
|||
{ |
|||
var services = new ServiceCollection(); |
|||
using (var application = AbpApplication.Create<AbpDeskConsoleDemoModule>(services)) |
|||
{ |
|||
application.Initialize(services.BuildServiceProvider()); |
|||
|
|||
application |
|||
.ServiceProvider |
|||
.GetRequiredService<TicketLister>() |
|||
.List(); |
|||
|
|||
Console.ReadLine(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
using System; |
|||
using AbpDesk.Tickets; |
|||
using Volo.DependencyInjection; |
|||
|
|||
namespace AbpDesk.ConsoleDemo |
|||
{ |
|||
public class TicketLister : ITransientDependency |
|||
{ |
|||
private readonly ITicketAppService _ticketAppService; |
|||
|
|||
public TicketLister(ITicketAppService ticketAppService) |
|||
{ |
|||
_ticketAppService = ticketAppService; |
|||
} |
|||
|
|||
public void List() |
|||
{ |
|||
var result = _ticketAppService.GetAll(); |
|||
|
|||
foreach (var ticket in result.Items) |
|||
{ |
|||
Console.WriteLine(ticket); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -1,13 +0,0 @@ |
|||
using System; |
|||
|
|||
namespace AbpDesk.ConsoleDemo |
|||
{ |
|||
public class Program |
|||
{ |
|||
public static void Main(string[] args) |
|||
{ |
|||
|
|||
Console.ReadLine(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace AbpDesk |
|||
{ |
|||
public class AbpDeskDomainModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddAssemblyOf<AbpDeskDomainModule>(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace AbpDesk.EntityFrameworkCore |
|||
{ |
|||
[DependsOn(typeof(AbpDeskDomainModule))] |
|||
public class AbpDeskEntityFrameworkCoreModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddAssemblyOf<AbpDeskEntityFrameworkCoreModule>(); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue