Skip to content

Instantly share code, notes, and snippets.

@micdenny
Last active December 1, 2016 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micdenny/b23fac112d8607b998e63e3b3adfa402 to your computer and use it in GitHub Desktop.
Save micdenny/b23fac112d8607b998e63e3b3adfa402 to your computer and use it in GitHub Desktop.
EFCore.PsToolsIssue7146
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace EFCore.PsToolsIssue7146.App
{
public class Program
{
public static void Main()
{
Console.WriteLine("Hello World!");
}
}
}
{
"version": "1.0.0-*",
"dependencies": {
},
"buildOptions": {
"emitEntryPoint": true
},
"frameworks": {
"net452": {
"dependencies": {
"EFCore.PsToolsIssue7146.Data": {
"target": "project"
}
}
}
}
}
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace EFCore.PsToolsIssue7146.Data
{
public class BloggingContext : DbContext
{
public DbSet<Blog> Blogs { get; set; }
public DbSet<Post> Posts { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=EFCore.PsToolsIssue7146;Trusted_Connection=True;");
}
}
public class Blog
{
public int BlogId { get; set; }
public string Url { get; set; }
public List<Post> Posts { get; set; }
}
public class Post
{
public int PostId { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public int BlogId { get; set; }
public Blog Blog { get; set; }
}
}
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.EntityFrameworkCore.SqlServer": "1.2.0-preview1-22845",
"Microsoft.EntityFrameworkCore.Design": "1.2.0-preview1-22845",
"Microsoft.EntityFrameworkCore.Tools": "1.2.0-preview4-22845"
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.2.0-preview4-22845"
},
"frameworks": {
"net452": {}
}
}
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-1-003177"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment