Created
September 25, 2013 15:13
-
-
Save aikmeng/6701132 to your computer and use it in GitHub Desktop.
Create wrapper for DBContext
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
namespace ExperimentNinjectEF.Data.Interface | |
{ | |
public interface IDbContext : IDisposable | |
{ | |
DbSet<TEntity> Set<TEntity>() where TEntity : class; | |
int SaveChanges(); | |
} | |
} | |
namespace ExperimentNinjectEF.Data | |
{ | |
public class BloggingContext : DbContext, IDbContext | |
{ | |
public IDbSet<Blog> Blogs { get; set; } | |
public IDbSet<Post> Posts { get; set; } | |
public BloggingContext() | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment