Skip to content

Instantly share code, notes, and snippets.

@codebeaulieu
Created May 19, 2015 02:48
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 codebeaulieu/9327e9b3e4045c93ea20 to your computer and use it in GitHub Desktop.
Save codebeaulieu/9327e9b3e4045c93ea20 to your computer and use it in GitHub Desktop.
Tag.cs | Stack Overflow | How do I use OnModelCreating with ApplicationDbContext?
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;
using System.Web;
namespace BlogEngine.Models
{
public class Tag : IEntity
{
[Key]
public int Id { get; set; }
public string Name { get; set; }
public int? Posts_Id { get; set; }
[ForeignKey("Posts_Id")]
public virtual List<Post> Posts { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment