Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
hikalkan committed Jul 28, 2016
2 parents f381496 + 2329521 commit c9d87c8
Show file tree
Hide file tree
Showing 1,423 changed files with 203,837 additions and 572 deletions.
7 changes: 7 additions & 0 deletions AbpCompanyName.AbpProjectName.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F10AA149-2
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "AbpCompanyName.AbpProjectName.Tests", "test\AbpCompanyName.AbpProjectName.Tests\AbpCompanyName.AbpProjectName.Tests.xproj", "{0D4C5D00-C144-4213-A007-4B8944113AB1}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "AbpCompanyName.AbpProjectName.Web.Tests", "test\AbpCompanyName.AbpProjectName.Web.Tests\AbpCompanyName.AbpProjectName.Web.Tests.xproj", "{5D441612-29CA-4DAD-9945-B9DE11CE026C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -48,6 +50,10 @@ Global
{0D4C5D00-C144-4213-A007-4B8944113AB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D4C5D00-C144-4213-A007-4B8944113AB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D4C5D00-C144-4213-A007-4B8944113AB1}.Release|Any CPU.Build.0 = Release|Any CPU
{5D441612-29CA-4DAD-9945-B9DE11CE026C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D441612-29CA-4DAD-9945-B9DE11CE026C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D441612-29CA-4DAD-9945-B9DE11CE026C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D441612-29CA-4DAD-9945-B9DE11CE026C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -58,5 +64,6 @@ Global
{3870C648-4AEA-4B85-BA3F-F2F63B96136A} = {AFAA0841-BD93-466F-B8F4-FB4EEC86F1FC}
{DC780BC4-4EAC-4C63-9052-6F3169A59FA4} = {AFAA0841-BD93-466F-B8F4-FB4EEC86F1FC}
{0D4C5D00-C144-4213-A007-4B8944113AB1} = {F10AA149-2626-486E-85BB-9CD5365F3016}
{5D441612-29CA-4DAD-9945-B9DE11CE026C} = {F10AA149-2626-486E-85BB-9CD5365F3016}
EndGlobalSection
EndGlobal
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ using ASP.NET Core and EntityFramework Core.

## Prerequirements

* Visual Studio 2015
* ASP.NET Core RC2 (Download here: https://go.microsoft.com/fwlink/?LinkId=798481)
* Visual Studio 2015 (Install Update3 if not installed: https://www.visualstudio.com/news/releasenotes/vs2015-update3-vs)
* ASP.NET Core (Install here: https://go.microsoft.com/fwlink/?LinkId=817245)
* SQL Server

## How To Run

* Open solution in Visual Studio 2015
* Set .Web project as Startup Project
* Set .Web project as Startup Project and build the project.
* Run database migrations
* Open command line
* Locate to the folder contains .EntityFrameworkCore project
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview1-002702"
"version": "1.0.0-preview2-003121"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Abp.Application.Services;
using Abp.ObjectMapping;

namespace AbpCompanyName.AbpProjectName
{
Expand All @@ -8,15 +7,8 @@ namespace AbpCompanyName.AbpProjectName
/// </summary>
public abstract class AbpProjectNameAppServiceBase : ApplicationService
{
/// <summary>
/// Reference to the object to object mapper.
/// TODO: REMOVE THIS WHEN IT'S ADDED TO ApplicationService in Abp.
/// </summary>
public IObjectMapper ObjectMapper { get; set; }

protected AbpProjectNameAppServiceBase()
{
ObjectMapper = NullObjectMapper.Instance;
LocalizationSourceName = AbpProjectNameConsts.LocalizationSourceName;
}
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 4 additions & 3 deletions src/AbpCompanyName.AbpProjectName.Application/project.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
{
"version": "1.0.0.0-*",

"dependencies": {
"Abp.AutoMapper": "0.9.4",
"AbpCompanyName.AbpProjectName.Core": "1.0.0.0-*"
"AbpCompanyName.AbpProjectName.Core": "1.0.0.0-*",
"Abp.EntityFrameworkCore": "0.10.3",
"Abp.AutoMapper": "0.10.3"
},

"frameworks": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
public class AbpProjectNameConsts
{
public const string LocalizationSourceName = "AbpProjectName";

public const string ConnectionStringName = "Default";
}
}
16 changes: 2 additions & 14 deletions src/AbpCompanyName.AbpProjectName.Core/AbpProjectNameCoreModule.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System.Reflection;
using Abp.Localization;
using Abp.Localization.Dictionaries;
using Abp.Localization.Dictionaries.Json;
using Abp.Modules;
using AbpCompanyName.AbpProjectName.Localization;

namespace AbpCompanyName.AbpProjectName
{
Expand All @@ -12,17 +10,7 @@ public override void PreInitialize()
{
Configuration.Auditing.IsEnabledForAnonymousUsers = true;

Configuration.Localization.Languages.Add(new LanguageInfo("en", "English", isDefault: true));
Configuration.Localization.Languages.Add(new LanguageInfo("tr", "Türkçe"));

Configuration.Localization.Sources.Add(
new DictionaryBasedLocalizationSource(AbpProjectNameConsts.LocalizationSourceName,
new JsonEmbeddedFileLocalizationDictionaryProvider(
Assembly.GetExecutingAssembly(),
"AbpCompanyName.AbpProjectName.Core.Localization.SourceFiles"
)
)
);
AbpProjectNameLocalizationConfigurer.Configure(Configuration.Localization);
}

public override void Initialize()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System.Collections.Concurrent;
using Abp.Extensions;
using Microsoft.Extensions.Configuration;

namespace AbpCompanyName.AbpProjectName.Configuration
{
public static class AppConfigurations
{
private static readonly ConcurrentDictionary<string, IConfigurationRoot> ConfigurationCache;

static AppConfigurations()
{
ConfigurationCache = new ConcurrentDictionary<string, IConfigurationRoot>();
}

public static IConfigurationRoot Get(string path, string environmentName = null)
{
var cacheKey = path + "#" + environmentName;
return ConfigurationCache.GetOrAdd(
cacheKey,
_ => BuildConfiguration(path, environmentName)
);
}

private static IConfigurationRoot BuildConfiguration(string path, string environmentName = null)
{
var builder = new ConfigurationBuilder()
.SetBasePath(path)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

if (!environmentName.IsNullOrWhiteSpace())
{
builder = builder.AddJsonFile($"appsettings.{environmentName}.json", optional: true);
}

builder = builder.AddEnvironmentVariables();

return builder.Build();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Reflection;
using Abp.Configuration.Startup;
using Abp.Localization;
using Abp.Localization.Dictionaries;
using Abp.Localization.Dictionaries.Json;

namespace AbpCompanyName.AbpProjectName.Localization
{
public static class AbpProjectNameLocalizationConfigurer
{
public static void Configure(ILocalizationConfiguration localizationConfiguration)
{
localizationConfiguration.Languages.Add(new LanguageInfo("en", "English", "famfamfam-flags england", isDefault: true));
localizationConfiguration.Languages.Add(new LanguageInfo("tr", "Türkçe", "famfamfam-flags tr"));

localizationConfiguration.Sources.Add(
new DictionaryBasedLocalizationSource(AbpProjectNameConsts.LocalizationSourceName,
new JsonEmbeddedFileLocalizationDictionaryProvider(
Assembly.GetExecutingAssembly(),
"AbpCompanyName.AbpProjectName.Core.Localization.SourceFiles"
)
)
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"texts": {
"HelloWorld": "Merhaba Dünya!",
"ChangeLanguage": "Dil değiştir",
"OurProducts": "Ürünlerimiz"
"HomePage": "Ana sayfa",
"About": "Hakkında",
"Home_Description": "AbpProjectName projesine hoşgeldiniz...",
"About_Description": "Bu proje, ASP.NET Core ile ABP framework kullanmak için basit bir başlangıç şablonudur."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"texts": {
"HelloWorld": "Hello World!",
"ChangeLanguage": "Change language",
"OurProducts": "Our products"
"HomePage": "HomePage",
"About": "About",
"Home_Description": "Welcome to AbpProjectName...",
"About_Description": "This is a simple startup template to use ASP.NET Core with ABP framework."
}
}
34 changes: 0 additions & 34 deletions src/AbpCompanyName.AbpProjectName.Core/Products/Product.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.IO;
using System.Linq;

namespace AbpCompanyName.AbpProjectName.Web
{
/// <summary>
/// This class is used to find root path of the web project in;
/// unit tests (to find views) and entity framework core command line commands (to find conn string).
/// </summary>
public static class WebContentDirectoryFinder
{
public static string CalculateContentRootFolder()
{
var coreAssemblyDirectoryPath = Path.GetDirectoryName(typeof(AbpProjectNameCoreModule).Assembly.Location);
if (coreAssemblyDirectoryPath == null)
{
throw new ApplicationException("Could not find location of AbpCompanyName.AbpProjectName.Core assembly!");
}

var directoryInfo = new DirectoryInfo(coreAssemblyDirectoryPath);
while (!DirectoryContains(directoryInfo.FullName, "AbpCompanyName.AbpProjectName.sln"))
{
if (directoryInfo.Parent == null)
{
throw new ApplicationException("Could not find content root folder!");
}

directoryInfo = directoryInfo.Parent;
}

return Path.Combine(directoryInfo.FullName, @"src\AbpCompanyName.AbpProjectName.Web");
}

private static bool DirectoryContains(string directory, string fileName)
{
return Directory.GetFiles(directory).Any(filePath => string.Equals(Path.GetFileName(filePath), fileName));
}
}
}
6 changes: 4 additions & 2 deletions src/AbpCompanyName.AbpProjectName.Core/project.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
{
"version": "1.0.0.0-*",

"dependencies": {
"Abp": "0.9.4.0-*"
"Abp": "0.10.3",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0"
},

"frameworks": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
using Abp.EntityFrameworkCore;
using AbpCompanyName.AbpProjectName.Products;
using Microsoft.EntityFrameworkCore;

namespace AbpCompanyName.AbpProjectName.EntityFrameworkCore
{
public class AbpProjectNameDbContext : AbpDbContext
{
//TODO: Define an DbSet for each Entity...

public DbSet<Product> Products { get; set; }

public AbpProjectNameDbContext(DbContextOptions<AbpProjectNameDbContext> options)
: base(options)
{
Expand Down
Loading

0 comments on commit c9d87c8

Please sign in to comment.