Skip to content

Commit

Permalink
#3 Updated asp.net packaged to beta8
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Gerbenis committed Oct 16, 2015
1 parent a516a20 commit 4839461
Show file tree
Hide file tree
Showing 21 changed files with 80 additions and 85 deletions.
1 change: 1 addition & 0 deletions vNext/BetterModules.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3E752E57-C27F-4A6D-8F02-12226E643F76}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
NuGet.Config = NuGet.Config
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "BetterModules.Core", "src\BetterModules.Core\BetterModules.Core.xproj", "{A7D843AE-B3B1-4929-9D1E-EFC78D02A4CD}"
Expand Down
15 changes: 15 additions & 0 deletions vNext/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="local" value="C:\DevBridge\nuget" />
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2/" />
</packageSources>
<disabledPackageSources>
<add key="nuget.org" value="true" />
<add key="AspNetVNext" value="true" />
</disabledPackageSources>
</configuration>
2 changes: 1 addition & 1 deletion vNext/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projects": [ "src", "test", "." ],
"sdk": {
"version": "1.0.0-beta7"
"version": "1.0.0-beta8"
}
}
1 change: 1 addition & 0 deletions vNext/src/BetterModules.Core.Web/Mvc/CoreControllerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using BetterModules.Core.Web.Models;
using BetterModules.Core.Web.Mvc.Extensions;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Filters;

namespace BetterModules.Core.Web.Mvc
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.IO;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.AspNet.Mvc.ViewEngines;
using Microsoft.AspNet.Mvc.ViewFeatures;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.OptionsModel;

Expand All @@ -20,7 +22,7 @@ public static string RenderViewToString(this CoreControllerBase controller, stri
{
var services = controller.ActionContext.HttpContext.RequestServices;
var compositeViewEngine = services.GetRequiredService<ICompositeViewEngine>();
var htmlHelperOptions = services.GetRequiredService<IOptions<MvcViewOptions>>().Options.HtmlHelperOptions;
var htmlHelperOptions = services.GetRequiredService<IOptions<MvcViewOptions>>().Value.HtmlHelperOptions;

if (string.IsNullOrEmpty(viewName) || viewName.ToLower() == controller.ActionContext.ActionDescriptor.Name.ToLower())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class DefaultHttpContextAccessor : HttpContextAccessor, IHttpContextAcces
public DefaultHttpContextAccessor(IOptions<DefaultWebConfigurationSection> configuration, IHostingEnvironment hostingEnvironment)
{
this.hostingEnvironment = hostingEnvironment;
this.configuration = configuration.Options;
this.configuration = configuration.Value;
}

// TBD: create a DefaultControllerContextAccessor service to get current controller views and etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using BetterModules.Core.Web.Modules;
using Microsoft.AspNet.FileProviders;
using Microsoft.Dnx.Runtime;
using Microsoft.Framework.Caching;
using Microsoft.Framework.Primitives;

namespace BetterModules.Core.Web.Web.EmbeddedResources
{
Expand Down Expand Up @@ -80,7 +80,7 @@ public IDirectoryContents GetDirectoryContents(string subpath)
return physicalFileProvider.GetDirectoryContents(subpath);
}

public IExpirationTrigger Watch(string filter)
public IChangeToken Watch(string filter)
{
return physicalFileProvider.Watch(filter);
}
Expand Down
6 changes: 3 additions & 3 deletions vNext/src/BetterModules.Core.Web/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

"dependencies": {
"BetterModules.Core": "2.0.0-*",
"Microsoft.AspNet.Http": "1.0.0-beta7",
"Microsoft.AspNet.Mvc": "6.0.0-beta7",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta7"
"Microsoft.AspNet.Http": "1.0.0-beta8",
"Microsoft.AspNet.Mvc": "6.0.0-beta8",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta8"
},

"frameworks": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public DefaultSessionFactoryProvider(IMappingResolver mappingResolver,
ILoggerFactory loggerFactory)
{
this.mappingResolver = mappingResolver;
this.configuration = configuration.Options;
this.configuration = configuration.Value;
this.principalProvider = principalProvider;
logger = loggerFactory.CreateLogger(typeof (DefaultSessionFactoryProvider).FullName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public DefaultMigrationRunner(IAssemblyLoader assemblyLoader,
ILoggerFactory loggerFactory)
{
this.assemblyLoader = assemblyLoader;
this.configuration = configuration.Options;
this.configuration = configuration.Value;
this.versionChecker = versionChecker;
logger = loggerFactory.CreateLogger(typeof (DefaultMigrationRunner).FullName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public DefaultWorkingDirectory(ILoggerFactory loggerFactory)
modulesFolder = new DirectoryInfo(Path.Combine(rootFolder.FullName, ModulesFolderName));
modulesRuntimeFolder = new DirectoryInfo(AppDomain.CurrentDomain.DynamicDirectory ?? AppDomain.CurrentDomain.BaseDirectory);

loggerFactory.CreateLogger(typeof (DefaultWorkingDirectory).FullName);
logger = loggerFactory.CreateLogger(typeof (DefaultWorkingDirectory).FullName);
}

/// <summary>
Expand Down
8 changes: 3 additions & 5 deletions vNext/src/BetterModules.Core/Extensions/TypeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Linq;

namespace BetterModules.Core.Extensions
{
Expand All @@ -16,12 +17,9 @@ public static bool IsAssignableToGenericType(this Type givenType, Type genericTy
{
var interfaceTypes = givenType.GetInterfaces();

foreach (var it in interfaceTypes)
if (interfaceTypes.Any(it => it.IsGenericType && it.GetGenericTypeDefinition() == genericType))
{
if (it.IsGenericType && it.GetGenericTypeDefinition() == genericType)
{
return true;
}
return true;
}

Type baseType = givenType.BaseType;
Expand Down
13 changes: 6 additions & 7 deletions vNext/src/BetterModules.Core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@
"authors": [ "Devbridge Group" ],
"tags": [ "" ],
"projectUrl": "https://github.com/devbridge/BetterModules",
"licenseUrl": "",


"dependencies": {
"NHibernate": "4.0.4.4000",
"FluentNHibernate": "2.0.1",
"FluentMigrator": "1.6.0",
"FluentMigrator.Tools": "1.6.0",
"FluentMigrator.Runner": "1.6.0",
"FluentMigrator.Runner.DNX": "1.0.0-alpha7",
"Microsoft.Framework.OptionsModel": "1.0.0-beta7",
"Microsoft.Framework.Configuration.Json": "1.0.0-beta6",
"Microsoft.Framework.Logging": "1.0.0-beta7",
"Microsoft.Framework.DependencyInjection": "1.0.0-beta7",
"Microsoft.Dnx.Runtime.Abstractions": "1.0.0-beta7"
"Microsoft.Framework.OptionsModel": "1.0.0-beta8",
"Microsoft.Framework.Configuration.Json": "1.0.0-beta8",
"Microsoft.Framework.Logging": "1.0.0-beta8",
"Microsoft.Framework.DependencyInjection": "1.0.0-beta8",
"Microsoft.Dnx.Runtime.Abstractions": "1.0.0-beta8"
},

"frameworks": {
Expand Down
47 changes: 9 additions & 38 deletions vNext/src/BetterModules.Mvc6.Sandbox/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,85 +1,56 @@
using BetterModules.Core.Extensions;
using BetterModules.Core.Web.Extensions;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Dnx.Runtime;
using Microsoft.Framework.Configuration;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.Logging;
using BetterModules.Core.Web.Extensions;

namespace BetterModules.Mvc6.Sandbox
{
public class Startup
{
public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
{
// Setup configuration sources.

var builder = new ConfigurationBuilder(appEnv.ApplicationBasePath)
.AddJsonFile("config.json")
.AddJsonFile($"config.{env.EnvironmentName}.json", optional: true)
var builder = new ConfigurationBuilder()
.SetBasePath(appEnv.ApplicationBasePath)
.AddJsonFile("Config/modules.json")
.AddJsonFile("Config/connectionStrings.json");
//.AddXmlFile("Config/modules.config")
//.AddXmlFile("Config/connectionStrings.config");

if (env.IsDevelopment())
{
// This reads the configuration keys from the secret store.
// For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709
builder.AddUserSecrets();
}
builder.AddEnvironmentVariables();
Configuration = builder.Build();
}

public IConfiguration Configuration { get; set; }

// This method gets called by the runtime. Use this method to add services to the container.

public void ConfigureServices(IServiceCollection services)
{
// Add MVC services to the services container.
services.AddMvc();
services.AddOptions();

//services.AddBetterModulesCore(Configuration, loggerFactory =>
//{
// loggerFactory.MinimumLevel = LogLevel.Verbose;
// loggerFactory.AddEventLog(LogLevel.Verbose);
// loggerFactory.AddConsole(LogLevel.Verbose);
//});
services.AddBetterModulesWeb(Configuration, loggerFactory =>
{
loggerFactory.MinimumLevel = LogLevel.Verbose;
loggerFactory.AddEventLog(LogLevel.Verbose);
loggerFactory.AddConsole(LogLevel.Verbose);
});
}

// Configure is called after ConfigureServices is called.

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
// Configure the HTTP request pipeline.

// Add the following to the request pipeline only in development environment.
if (env.IsDevelopment())
{
app.UseBrowserLink();
app.UseErrorPage();
app.UseDeveloperExceptionPage();
}
else
{
// Add Error handling middleware which catches all application specific errors and
// sends the request to the following path or controller action.
app.UseErrorHandler("/Home/Error");
app.UseExceptionHandler("/Home/Error");
}

app.UseBetterStaticFiles();

// Add static files to the request pipeline.
app.UseStaticFiles();

// Add MVC to the request pipeline.

app.UseMvc(routes =>
{
routes.MapRoute(
Expand Down
38 changes: 18 additions & 20 deletions vNext/src/BetterModules.Mvc6.Sandbox/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,27 @@
"version": "1.0.0-*",

"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-beta7",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta6",
"Microsoft.AspNet.Diagnostics": "1.0.0-beta6",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta6",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta6",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-beta6",
"Microsoft.Framework.Configuration.Abstractions": "1.0.0-beta7",
"Microsoft.Framework.Configuration.Json": "1.0.0-beta7",
"Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta7",
"Microsoft.Framework.Logging": "1.0.0-beta7",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta6",
"BetterModules.Core": "1.0.0-*",
"BetterModules.Sample.Module": "1.0.0-*",
"Microsoft.Framework.Logging.EventLog": "1.0.0-beta7",
"Microsoft.Framework.Logging.Console": "1.0.0-beta7",
"Microsoft.Framework.Configuration.Xml": "1.0.0-beta7",
"BetterModules.Core.Web": "1.0.0-*",
"BetterModules.Sample.Web.Module": "1.0.0-*"
"BetterModules.Core.Web": "2.0.0-*",
"BetterModules.Sample.Module": "2.0.0-*",
"BetterModules.Sample.Web.Module": "2.0.0-*",
"Microsoft.AspNet.Diagnostics": "1.0.0-beta8",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-beta8",
"Microsoft.AspNet.Mvc": "6.0.0-beta8",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta8",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta8",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-beta8",
"Microsoft.Framework.Configuration.Abstractions": "1.0.0-beta8",
"Microsoft.Framework.Configuration.Json": "1.0.0-beta8",
"Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta8",
"Microsoft.Framework.Logging": "1.0.0-beta8",
"Microsoft.Framework.Logging.Console": "1.0.0-beta8",
"Microsoft.Framework.Logging.Debug": "1.0.0-beta8",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta8"
},

"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
"web": "Microsoft.AspNet.Server.Kestrel",
"gen": "Microsoft.Framework.CodeGeneration"
},

Expand Down
9 changes: 9 additions & 0 deletions vNext/src/BetterModules.Mvc6.Sandbox/wwwroot/web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" forwardWindowsAuthToken="false" startupTimeLimit="3600" />
</system.webServer>
</configuration>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ private void InitializeServices()
services.AddSingleton<ILoggerFactory, LoggerFactory>();
services.AddInstance(manager.Object);
services.AddOptions();
var builder = new ConfigurationBuilder(System.Environment.CurrentDirectory)
var builder = new ConfigurationBuilder()
.SetBasePath(System.Environment.CurrentDirectory)
.AddJsonFile("Config/modules.json")
.AddJsonFile("Config/connectionStrings.json")
.AddInMemoryCollection(new List<KeyValuePair<string, string>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void RunMigrations(List<ModuleDescriptor> descriptors, IVersionChecker ve

var configuration = new Mock<IOptions<DefaultConfigurationSection>>();
configuration
.Setup(c => c.Options)
.Setup(c => c.Value)
.Returns(() => new DefaultConfigurationSection
{
Database = new DatabaseConfigurationElement
Expand Down
4 changes: 2 additions & 2 deletions vNext/test/BetterModules.Core.Tests/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"dependencies": {
"xunit": "2.1.0",
"xunit.runner.dnx": "2.1.0-beta5a-build188",
"BetterModules.Core": "1.0.0-*",
"BetterModules.Sample.Module": "1.0.0-*",
"BetterModules.Core": "2.0.0-*",
"BetterModules.Sample.Module": "2.0.0-*",
"Moq": "4.2.1506.2515"
},

Expand Down

0 comments on commit 4839461

Please sign in to comment.