Created
April 29, 2018 03:46
-
-
Save FernandoZhuang/6da046b7f3e82071c20fbab9fd042af9 to your computer and use it in GitHub Desktop.
WebChat: MVC Context
This file contains 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.Linq; | |
using System.Web; | |
using System.Data.Entity; | |
namespace ChildChat.Models | |
{ | |
public class ChatContext:DbContext | |
{ | |
public ChatContext() : base("SqlConnect") | |
{ | |
} | |
public static ChatContext Create() | |
{ | |
return new ChatContext(); | |
} | |
public DbSet<User> Users { get; set; } | |
public DbSet<Conversation> Conversations { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment