public ActionResult ViewProject(int id)
        {
            var projectRepository = new SimpleRepository <Project>();
            var project           = projectRepository.Get(id);
            var projectModel      = Mapper.Map <Project, ProjectModel>(project);

            return(View(projectModel));
        }
Beispiel #2
0
        public void Get_returns_null_when_no_data_setup()
        {
            // Arrange
            var columns = new[] { nameof(SimpleObject.Id), nameof(SimpleObject.Name), nameof(SimpleObject.DateOfBirth) };
            var rows    = Enumerable.Empty <object[]>();
            var table   = new FakeTable(rows, columns);

            var cmdToReturn = new FakeCommand(table);

            _connectionFactory.Connection.Setup(cmdToReturn);

            // Act
            var instance = _repository.Get();

            // Assert
            Assert.Null(instance);
        }
Beispiel #3
0
 public List <CategoriesApiResponce> Get()
 {
     return(SimpleRepository.Get <Category>().Select(t =>
     {
         var category = ModelsMapper.Map <CategoriesApiResponce>(t);
         category.Image = Path.Combine(ProductsImagesFolderPath, t.Image ?? "");
         return category;
     }).ToList());
 }
 public List <ProductsApiResponce> Get()
 {
     return(SimpleRepository.Get <Product>().Select(t =>
     {
         var tempTemplate = ModelsMapper.Map <ProductsApiResponce>(t);
         tempTemplate.ImageForTarget = Path.Combine(ProductsImagesFolderPath, t.ImageForTarget ?? "");
         tempTemplate.Model = Path.Combine(ProductsImagesFolderPath, t.Model ?? "");
         tempTemplate.texturesObj = "";
         return tempTemplate;
     }).ToList());
 }
Beispiel #5
0
        public T Get(int id)
        {
            var repo = new SimpleRepository <T>(connectionFactory);

            var item = repo.Get(id);

            if (item != null)
            {
                return(item);
            }
            else
            {
                throw new HttpResponseException(System.Net.HttpStatusCode.NotFound);
            }
        }
Beispiel #6
0
        public AssetBundle Get(int id)
        {
            var repo = new SimpleRepository <AssetBundle>(con);

            return(repo.Get(id));
        }
Beispiel #7
0
        public DataSet Get(int id)
        {
            var repo = new SimpleRepository <DataSet>(con);

            return(repo.Get(id));
        }
Beispiel #8
0
        public Dll Get(int id)
        {
            var repo = new SimpleRepository <Dll>(con);

            return(repo.Get(id));
        }