public async Task <AppVariableSearch> Insert(AppVariableSearch appVariableSearch)
        {
            await _unitOfWork.AppVariableSearchRepository.Add(appVariableSearch);

            await _unitOfWork.SaveChangesAsync();

            return(appVariableSearch);
        }
        public async Task CreateVariableSearchTextBySubcategoryVariableSearchTex(int appSubCategoryId, int appVariableId, string searchText)
        {
            var variable = await _unitOfWork.AppVariableSearchRepository.GetVariableSearchTextBySubcategoryVariableSearchTex(appSubCategoryId, appVariableId, searchText);

            if (variable == null)
            {
                AppVariableSearch appVariableSearch = new AppVariableSearch();
                appVariableSearch.AppVariableId    = appVariableId;
                appVariableSearch.AppSubCategoryId = appSubCategoryId;
                appVariableSearch.SearchText       = searchText;
                await  Insert(appVariableSearch);
            }
        }
        public async Task <AppVariableSearch> Update(AppVariableSearch appVariableSearch)
        {
            var variables = await GetById(appVariableSearch.Id);

            if (variables == null)
            {
                throw new Exception("Documento No existe");
            }

            _unitOfWork.AppVariableSearchRepository.Update(appVariableSearch);
            await _unitOfWork.SaveChangesAsync();

            return(await GetById(appVariableSearch.Id));
        }
Esempio n. 4
0
        public async Task Delete(int id)
        {
            AppVariableSearch entity = await GetById(id);

            _context.AppVariableSearch.Remove(entity);
        }
Esempio n. 5
0
 public void Update(AppVariableSearch entity)
 {
     _context.AppVariableSearch.Update(entity);
 }
Esempio n. 6
0
 public async Task Add(AppVariableSearch entity)
 {
     await _context.AppVariableSearch.AddAsync(entity);
 }