Created
May 16, 2012 08:37
-
-
Save lukemcgregor/2708741 to your computer and use it in GitHub Desktop.
Shows that EF by default uses _ in fk names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Data.Entity; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication3 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
using (var ctx = new MyContext()) | |
{ | |
ctx.Status.ToList(); | |
} | |
} | |
} | |
public class MyContext : DbContext | |
{ | |
public DbSet<Podcast> Podcasts { get; set; } | |
public DbSet<Status> Status { get; set; } | |
} | |
public class Status | |
{ | |
public int Id { get; set; } | |
} | |
public class Podcast | |
{ | |
public int Id { get; set; } | |
public virtual Status Status { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment