Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ExperimentMoq
- {
- public class DbEntity
- {
- public int Id { get; set; }
- public string Name { get; set; }
- }
- public class CustomDbContext : DbContext, IDisposable
- {
- public virtual IDbSet<DbEntity> DbEntities { get; set; }
- }
- public class Processor
- {
- private readonly CustomDbContext _dbContext;
- public Processor(CustomDbContext dbContext)
- {
- _dbContext = dbContext;
- }
- public DbEntity Find(int id)
- {
- return _dbContext.DbEntities.FirstOrDefault(dbEntity => dbEntity.Id == id);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement