public IEnumerable <Host> RetrieveHosts() { using (ReadUncommitedTransactionScope) using (var context = _databaseFactory.CreateContext()) { return(context .Hosts .Include(o => o.Organisation) .AsNoTracking() .ToList()); } }
public void Create <T>(T entity) where T : class { using (var context = _databaseFactory.CreateContext()) { _genericDataService.Context = context; _genericDataService.Create(entity); _genericDataService.Save(); } }