Skip to content

Instantly share code, notes, and snippets.

@FernandoZhuang
Created April 29, 2018 03:46
Show Gist options
  • Save FernandoZhuang/6da046b7f3e82071c20fbab9fd042af9 to your computer and use it in GitHub Desktop.
Save FernandoZhuang/6da046b7f3e82071c20fbab9fd042af9 to your computer and use it in GitHub Desktop.
WebChat: MVC Context
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