Skip to content

Commit c9bd863

Browse files
authored
Merge pull request #28 from aspnetboilerplate/netcore
Converted to netcore
2 parents b0dd1f0 + a79afc6 commit c9bd863

17 files changed

+35
-41
lines changed

src/AbpCompanyName.AbpProjectName.Application/AbpCompanyName.AbpProjectName.Application.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
<PropertyGroup>
44
<VersionPrefix>1.0.0.0</VersionPrefix>
5-
<TargetFramework>net461</TargetFramework>
5+
<TargetFrameworks>net461;netcoreapp1.1</TargetFrameworks>
66
<AssemblyName>AbpCompanyName.AbpProjectName.Application</AssemblyName>
77
<PackageId>AbpCompanyName.AbpProjectName.Application</PackageId>
88
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
99
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1010
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
11+
<RootNamespace>AbpCompanyName.AbpProjectName</RootNamespace>
1112
</PropertyGroup>
1213

1314
<ItemGroup>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using System.Reflection;
2-
using Abp.AutoMapper;
1+
using Abp.AutoMapper;
32
using Abp.Modules;
3+
using Abp.Reflection.Extensions;
44

55
namespace AbpCompanyName.AbpProjectName
66
{
@@ -11,7 +11,7 @@ public class AbpProjectNameApplicationModule : AbpModule
1111
{
1212
public override void Initialize()
1313
{
14-
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
14+
IocManager.RegisterAssemblyByConvention(typeof(AbpProjectNameApplicationModule).GetAssembly());
1515
}
1616
}
1717
}

src/AbpCompanyName.AbpProjectName.Core/AbpCompanyName.AbpProjectName.Core.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
<PropertyGroup>
44
<VersionPrefix>1.0.0.0</VersionPrefix>
5-
<TargetFramework>net461</TargetFramework>
5+
<TargetFrameworks>net461;netcoreapp1.1</TargetFrameworks>
66
<AssemblyName>AbpCompanyName.AbpProjectName.Core</AssemblyName>
77
<PackageId>AbpCompanyName.AbpProjectName.Core</PackageId>
88
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
99
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1010
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
11+
<RootNamespace>AbpCompanyName.AbpProjectName</RootNamespace>
1112
</PropertyGroup>
1213

1314
<ItemGroup>

src/AbpCompanyName.AbpProjectName.Core/AbpProjectNameCoreModule.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.Reflection;
2-
using Abp.Modules;
1+
using Abp.Modules;
2+
using Abp.Reflection.Extensions;
33
using AbpCompanyName.AbpProjectName.Localization;
44

55
namespace AbpCompanyName.AbpProjectName
@@ -15,7 +15,7 @@ public override void PreInitialize()
1515

1616
public override void Initialize()
1717
{
18-
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
18+
IocManager.RegisterAssemblyByConvention(typeof(AbpProjectNameCoreModule).GetAssembly());
1919
}
2020
}
2121
}

src/AbpCompanyName.AbpProjectName.Core/Localization/AbpProjectNameLocalizationConfigurer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Abp.Localization;
44
using Abp.Localization.Dictionaries;
55
using Abp.Localization.Dictionaries.Json;
6+
using Abp.Reflection.Extensions;
67

78
namespace AbpCompanyName.AbpProjectName.Localization
89
{
@@ -16,8 +17,8 @@ public static void Configure(ILocalizationConfiguration localizationConfiguratio
1617
localizationConfiguration.Sources.Add(
1718
new DictionaryBasedLocalizationSource(AbpProjectNameConsts.LocalizationSourceName,
1819
new JsonEmbeddedFileLocalizationDictionaryProvider(
19-
Assembly.GetExecutingAssembly(),
20-
"AbpCompanyName.AbpProjectName.Core.Localization.SourceFiles"
20+
typeof(AbpProjectNameLocalizationConfigurer).GetAssembly(),
21+
"AbpCompanyName.AbpProjectName.Localization.SourceFiles"
2122
)
2223
)
2324
);

src/AbpCompanyName.AbpProjectName.Core/Web/WebContentFolderHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ public static string CalculateContentRootFolder()
1515
var coreAssemblyDirectoryPath = Path.GetDirectoryName(AppContext.BaseDirectory);
1616
if (coreAssemblyDirectoryPath == null)
1717
{
18-
throw new ApplicationException("Could not find location of AbpCompanyName.AbpProjectName.Core assembly!");
18+
throw new Exception("Could not find location of AbpCompanyName.AbpProjectName.Core assembly!");
1919
}
2020

2121
var directoryInfo = new DirectoryInfo(coreAssemblyDirectoryPath);
2222
while (!DirectoryContains(directoryInfo.FullName, "AbpCompanyName.AbpProjectName.sln"))
2323
{
2424
if (directoryInfo.Parent == null)
2525
{
26-
throw new ApplicationException("Could not find content root folder!");
26+
throw new Exception("Could not find content root folder!");
2727
}
2828

2929
directoryInfo = directoryInfo.Parent;

src/AbpCompanyName.AbpProjectName.EntityFrameworkCore/AbpCompanyName.AbpProjectName.EntityFrameworkCore.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
<PropertyGroup>
44
<VersionPrefix>1.0.0.0</VersionPrefix>
5-
<TargetFramework>net461</TargetFramework>
5+
<TargetFrameworks>net461;netcoreapp1.1</TargetFrameworks>
66
<AssemblyName>AbpCompanyName.AbpProjectName.EntityFrameworkCore</AssemblyName>
7-
<OutputType>Exe</OutputType>
7+
<OutputType>Library</OutputType>
88
<PackageId>AbpCompanyName.AbpProjectName.EntityFrameworkCore</PackageId>
99
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1010
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1111
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
12+
<RootNamespace>AbpCompanyName.AbpProjectName</RootNamespace>
1213
</PropertyGroup>
1314

1415
<ItemGroup>

src/AbpCompanyName.AbpProjectName.EntityFrameworkCore/EntityFrameworkCore/AbpProjectNameDbContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ namespace AbpCompanyName.AbpProjectName.EntityFrameworkCore
55
{
66
public class AbpProjectNameDbContext : AbpDbContext
77
{
8+
//Add DbSet properties for your entities...
9+
810
public AbpProjectNameDbContext(DbContextOptions<AbpProjectNameDbContext> options)
911
: base(options)
1012
{

src/AbpCompanyName.AbpProjectName.EntityFrameworkCore/EntityFrameworkCore/AbpProjectNameDbContextFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace AbpCompanyName.AbpProjectName.EntityFrameworkCore
88
{
9-
/* This class is needed to run "dotnet ef ..." commands from command line on development. Not used anywhere else */
9+
/* This class is needed to run EF Core PMC commands. Not used anywhere else */
1010
public class AbpProjectNameDbContextFactory : IDbContextFactory<AbpProjectNameDbContext>
1111
{
1212
public AbpProjectNameDbContext Create(DbContextFactoryOptions options)
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using System.Reflection;
2-
using Abp.EntityFrameworkCore;
1+
using Abp.EntityFrameworkCore;
32
using Abp.Modules;
3+
using Abp.Reflection.Extensions;
44

55
namespace AbpCompanyName.AbpProjectName.EntityFrameworkCore
66
{
@@ -11,7 +11,7 @@ public class AbpProjectNameEntityFrameworkCoreModule : AbpModule
1111
{
1212
public override void Initialize()
1313
{
14-
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
14+
IocManager.RegisterAssemblyByConvention(typeof(AbpProjectNameEntityFrameworkCoreModule).GetAssembly());
1515
}
1616
}
1717
}

0 commit comments

Comments
 (0)