Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Data.Entity;
- using Freelancers.Infrastructure;
- using Freelancers.Infrastructure.Interfaces;
- namespace Freelancers.Model
- {
- public class DatabaseFactory : Disposable, IDatabaseFactory
- {
- private FreelancersContext _dataContext;
- public DbContext Get()
- {
- return _dataContext ?? (_dataContext = new FreelancersContext());
- }
- protected override void DisposeCore()
- {
- if(_dataContext != null)
- _dataContext.Dispose();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment