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