예제 #1
0
 public TwitterApp GetItem(int id)
 {
     using (_connection = Utilities.Database.GetProfiledOpenConnection())
     {
         return _connection.Get<TwitterApp>(id);
     }
 }
 public RestaurantType Get(int id)
 {
     using (_connection = Utilities.GetProfiledOpenConnection())
     {
         return _connection.Get<RestaurantType>(id);
     }
 }
예제 #3
0
 public Veto Get(int id)
 {
     using (_connection = Utilities.GetProfiledOpenConnection())
     {
         return _connection.Get<Veto>(id);
     }
 }
예제 #4
0
 public Vote GetItem(int id)
 {
     using (_connection = Utilities.GetProfiledOpenConnection())
     {
         return _connection.Get<Vote>(id);
     }
 }
예제 #5
0
 public JobLog Get(int id)
 {
     using (_connection = Utilities.GetProfiledOpenConnection())
     {
         return _connection.Get<JobLog>(id);
     }
 }
예제 #6
0
 public ActionResult Edit(int id)
 {
     CarViewModel model;
     using (_connection = Utilities.GetOpenConnection())
     {
         model = _connection.Get<CarViewModel>(id);
     }
     return View(model);
 }
예제 #7
0
 public ActionResult Details(int id)
 {
     CarViewModel result;
     using (_connection = Utilities.GetOpenConnection())
     {
         result = _connection.Get<CarViewModel>(id);
     }
     return View(result);
 }
 public ActionResult Edit(string id)
 {
     GUIDTestViewModel model;
     using (_connection = Utilities.GetOpenConnection())
     {
         model = _connection.Get<GUIDTestViewModel>(id);
     }
     return View(model);
 }
 public ActionResult Details(string id)
 {
     GUIDTestViewModel result;
     using (_connection = Utilities.GetOpenConnection())
     {
         result = _connection.Get<GUIDTestViewModel>(id);
     }
     return View(result);
 }
예제 #10
0
 public ActionResult Edit(int id)
 {
     User model;
     using (_connection = Utilities.GetOpenConnection())
     {
         model = _connection.Get<User>(id);
     }
     return View(UserAddEdit.MapUserToUserAddEdit(model));
 }
예제 #11
0
 public ActionResult Edit(int id)
 {
     Car model;
     using (_connection = Utilities.GetOpenConnection())
     {
         model = _connection.Get<Car>(id);
     }
     return View(CarAddEdit.MapCarToCarAddEdit(model));
 }
예제 #12
0
        public User Get(int id, UserDependencies? dependencies)
        {
            using (_connection = Utilities.GetProfiledOpenConnection())
            {
                var user = _connection.Get<User>(id);

                if ((dependencies & UserDependencies.Vetoes) == UserDependencies.Vetoes)
                {
                    List<Veto> vetoes = null;
                    if (user != null) vetoes = _vetoRepository.GetAll(user.Id).ToList();
                    if (vetoes != null)
                        user.Vetoes = vetoes.FindAll(v => v.UserId == user.Id);
                }

                return user;
            }
        }
예제 #13
0
 public Search GetItem(long id, SearchDependencies? dependencies = null)
 {
     using (_connection = Utilities.Database.GetProfiledOpenConnection())
     {
         var entity = _connection.Get<Search>(id);
         if (entity != null)
         {
             if (dependencies != null)
             {
                 entity.Logs = _searchHistoryLogRepository.GetItems(entity.SearchId);
                 if (entity.Logs.Any())
                 {
                     entity.LastLog = entity.Logs.OrderByDescending(l => l.SearchDate).First();
                 }
             }
         }
         return entity;
     }
 }