Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

Update templates to support the new pattern used for integration tests #78

Merged
merged 1 commit into from
Oct 27, 2017

Conversation

javiercn
Copy link
Member

I tried running the EF tools with both patterns to verify that they both work. Below is the output

C:\work\template-tests\pattern> cat .\Program.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace pattern
{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateWebHostBuilder(args).Build().Run();
        }

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>();
    }
}
C:\work\template-tests\pattern> dotnet ef migrations list
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using 'C:\Users\jacalvar\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
      Entity Framework Core 2.1.0-preview1-27373 initialized 'ApplicationDbContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: None
00000000000000_CreateIdentitySchema
C:\work\template-tests\pattern> code . .\Program.cs
C:\work\template-tests\pattern> cat .\Program.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace pattern
{
    public class Program
    {
        public static void Main(string[] args)
        {
            BuildWebHost(args).Run();
        }

        public static IWebHost BuildWebHost(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>()
                .Build();
    }
}

C:\work\template-tests\pattern> dotnet ef migrations list
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using 'C:\Users\jacalvar\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
      Entity Framework Core 2.1.0-preview1-27373 initialized 'ApplicationDbContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: None
00000000000000_CreateIdentitySchema
```

@javiercn javiercn requested review from Eilon and rynowak October 21, 2017 00:34
@dnfclas
Copy link

dnfclas commented Oct 21, 2017

@javiercn,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

Copy link
Member

@Eilon Eilon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per my understanding of what this ought to look like, this is good.

}

public static IWebHost BuildWebHost(string[] args) =>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this break EF tooling? /cc @bricelam

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe EF tooling was updated by @javiercn .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, so EF tooling now supports both patterns? So, this change will work with EF Core 2.1, but not with 2.0, but an app created using the 2.0 pattern will continue to work with 2.1? If so, I think that's okay.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep

Copy link
Member

@Eilon Eilon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SteveSandersonMS
Copy link
Member

@Eilon Any changes to the .NET parts of the project templates should be applied to the SPA ones at the same time, yes.

@javiercn
Copy link
Member Author

@SteveSandersonMS I've updated the spa templates with the new pattern.
@Eilon I've also updated the F# templates.

@@ -13,14 +13,13 @@ open Microsoft.Extensions.Logging
module Program =
let exitCode = 0

let BuildWebHost args =
let CreateWebHostBuilder args =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very... nice?? 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants