public IList <EquivalenciaEntreUnidadesDeMedidaViewModel> Find(string text, int?fromIndex = null, int?toIndex = null) { IList <EquivalenciaEntreUnidadesDeMedida> modelObjs = null; if (string.IsNullOrEmpty(text)) { modelObjs = _service.Find(p => true, fromIndex, toIndex); } else { modelObjs = _service.Find( p => (p.Nome.ToLower().Contains(text.ToLower())) || (p.Origem.Id.ToString().ToLower().Contains(text.ToLower())) || (p.Origem.Nome.ToLower().Contains(text.ToLower())) || (p.Origem.NomeResumido.ToLower().Contains(text.ToLower())) || (p.Origem.Sinonimos.ToLower().Contains(text.ToLower())) || (p.Destino.Id.ToString().ToLower().Contains(text.ToLower())) || (p.Destino.Nome.ToLower().Contains(text.ToLower())) || (p.Destino.NomeResumido.ToLower().Contains(text.ToLower())) || (p.Destino.Sinonimos.ToLower().Contains(text.ToLower())) || (p.Sinonimos.ToLower().Contains(text.ToLower())) , fromIndex, toIndex); } return(_mapper.Map <List <EquivalenciaEntreUnidadesDeMedidaViewModel> >(modelObjs)); }
public IList <AvaliacaoDoUsuarioViewModel> Find(string text, int?fromIndex = null, int?toIndex = null) { IList <AvaliacaoDoUsuario> modelObjs = null; if (string.IsNullOrEmpty(text)) { modelObjs = _service.Find(p => true, fromIndex, toIndex); } else { modelObjs = _service.Find( p => (p.Nome.ToLower().Contains(text.ToLower())) || (p.UsuarioId.ToString().ToLower().Contains(text.ToLower())) || (p.Usuario.Nome.ToLower().Contains(text.ToLower())) || ((p.ReceitaId ?? Guid.Empty).ToString().ToLower().Contains(text.ToLower())) || (p.Receita == null ? false : p.Receita.Nome.ToLower().Contains(text.ToLower())) || ((p.ReceitaDeQuemEhAvaliacaoMediaId ?? Guid.Empty).ToString().ToLower().Contains(text.ToLower())) || (p.ReceitaDeQuemEhAvaliacaoMedia == null ? false : p.ReceitaDeQuemEhAvaliacaoMedia.Nome.ToLower().Contains(text.ToLower())) || (p.QuantidadeEstrelas.ToString().ToLower().Contains(text.ToLower())) || (p.Sinonimos.ToLower().Contains(text.ToLower())) , fromIndex, toIndex); } return(_mapper.Map <List <AvaliacaoDoUsuarioViewModel> >(modelObjs)); }
public virtual IActionResult Find(int id) { var result = _service.Find(id); if (result == null) { return(NotFound()); } return(Ok(result)); }
public IActionResult DeletarDoCarrinho(int clienteId, int carrinhoId, int produtoId) { if (!ClienteValido(clienteId)) { return(Forbid()); } var produto = _produtoService.Find(x => x.Id == produtoId); produto.RemoverDoCarrinho(); return(Ok()); }
private List <ItemParaComputarIngrediente> ObterDadosAgrupados(Guid id) { var from = 0; var to = -1; var itensCardapio = _itemService.Find(p => p.CardapioId == id, from, to); ItemParaComputarIngrediente ocor = null; List <ItemListaIngredientes> itensIng = null; ItemListaIngredientes itemIngAtual = null; var agrupadoPorIng = new List <ItemParaComputarIngrediente>(); foreach (var item in itensCardapio) { var itensCardRec = _itemReceitaService.Find(p => p.ItemCardapioId == item.Id, 0, -1); foreach (var itemCardRec in itensCardRec) { itensIng = _ingredientesService.Find(p => p.ReceitaId == itemCardRec.ReceitaId, 0, -1).ToList(); foreach (var itemIng in itensIng) { itemIngAtual = itemIng; //procura nos agrpamentos ocor = agrupadoPorIng.Find(p => p.IngredienteId == itemIngAtual.Ingrediente.Id && p.UnidadeMedidaId == itemIngAtual.UnidadeMedidaId); if (ocor == null) { ocor = new ItemParaComputarIngrediente(_receitaService, _param) { IngredienteId = itemIngAtual.Ingrediente.Id, NomeIngrediente = itemIngAtual.Ingrediente.Nome, QuantidadeTotal = 0.0, UnidadeMedidaId = itemIngAtual.UnidadeMedidaId, NomeUnidadeMedida = itemIngAtual.UnidadeMedida.Nome, NomeCategoria = ObterCaminhoCategoria(itemIngAtual.Ingrediente) }; ocor.Add(item, itemIngAtual.Receita, itemIngAtual); agrupadoPorIng.Add(ocor); } else { ocor.Add(item, itemIngAtual.Receita, itemIngAtual); } } } } return(agrupadoPorIng); }
public string GetBy(string propertyName, string propertyValue, bool isExcludeDeleted = false) { ICollection <QueryFilter> filters = new List <QueryFilter>(); filters.Add(new QueryFilter(propertyName, propertyValue, Operator.Equals)); if (isExcludeDeleted) { filters.Add(new QueryFilter("IsDeleted", "0")); } Expression <Func <TEntity, bool> > query = ExpressionBuilder.GetExpression <TEntity>(filters); IList <TEntity> entities = _service.Find(query).ToList(); string result = entities.Any() ? JsonHelper <TEntity> .Serialize(entities[0]) : string.Empty; return(result); }
public IList <CardapioViewModel> Find(string text, int?fromIndex = null, int?toIndex = null) { IList <Cardapio> modelObjs = null; if (string.IsNullOrEmpty(text)) { modelObjs = _service.Find(p => true, fromIndex, toIndex); } else { modelObjs = _service.Find( p => (p.Nome.ToLower().Contains(text.ToLower())) || (p.Sinonimos.ToLower().Contains(text.ToLower())) , fromIndex, toIndex); } return(_mapper.Map <List <CardapioViewModel> >(modelObjs)); }
public string Find(ICollection <QueryFilter> filters) { Expression <Func <TEntity, bool> > query = ExpressionBuilder.GetExpression <TEntity>(filters); IEnumerable <TEntity> entities = _service.Find(query).ToList(); string result = entities.Any() ? JsonHelper <TEntity> .Serialize(entities) : string.Empty; return(result); }
private bool ClienteValido(int clienteId) { if (_clienteService.Find(x => x.Id == clienteId) == null) { return(false); } return(true); }
public IList <FontePropriedadeIntelectualViewModel> Find(string text, int?fromIndex = null, int?toIndex = null) { IList <FontePropriedadeIntelectual> modelObjs = null; if (string.IsNullOrEmpty(text)) { modelObjs = _service.Find(p => true, fromIndex, toIndex); } else { modelObjs = _service.Find( p => (p.Nome.ToLower().Contains(text.ToLower())) || (p.EdicaoDoLivro.ToLower().Contains(text.ToLower())) || (p.Titulo.ToLower().Contains(text.ToLower())) || (p.Sinonimos.ToLower().Contains(text.ToLower())) , fromIndex, toIndex); } return(_mapper.Map <List <FontePropriedadeIntelectualViewModel> >(modelObjs)); }
public IActionResult BuscarPorId(int id) { var cliente = _service.Find(x => x.Id == id); if (cliente == null) { return(NotFound()); } return(Ok(cliente)); }
protected ActionResult Find(Guid id) { var response = _service.Find(id); if (response == null) { return(NotFound()); } return(Ok(MapperHelper.Map <T, TDto>(response))); }
public IList <CategoriaViewModel> Find(string text, int?fromIndex = null, int?toIndex = null) { IList <Categoria> modelObjs = null; if (string.IsNullOrEmpty(text)) { modelObjs = _service.Find(p => true, fromIndex, toIndex); } else { modelObjs = _service.Find( p => (p.Nome.ToLower().Contains(text.ToLower())) || ((p.CategoriaPaiId ?? Guid.Empty).ToString().ToLower().Contains(text.ToLower())) || (p.CategoriaPai == null ? false : p.CategoriaPai.Nome.ToLower().Contains(text.ToLower())) || (p.Sinonimos.ToLower().Contains(text.ToLower())) , fromIndex, toIndex); } return(_mapper.Map <List <CategoriaViewModel> >(modelObjs)); }
public IList <EtapaDePreparoViewModel> Find(string text, int?fromIndex = null, int?toIndex = null) { IList <EtapaDePreparo> modelObjs = null; if (string.IsNullOrEmpty(text)) { modelObjs = _service.Find(p => true, fromIndex, toIndex); } else if (text.ToLower().Contains("receitaid=")) { var receitaId = text.Substring(10); modelObjs = _service.Find(p => p.ReceitaId.ToString() == receitaId, fromIndex, toIndex); } else { modelObjs = _service.Find( p => (p.Nome.ToLower().Contains(text.ToLower())) || (p.Sinonimos.ToLower().Contains(text.ToLower())) , fromIndex, toIndex); } return(_mapper.Map <List <EtapaDePreparoViewModel> >(modelObjs)); }
public TEntity Find(params object[] Keys) { return(_service.Find(Keys)); }
public IList <TViewModel> Find(Func <TModel, bool> predicate) { return(_mapper.Map <IList <TViewModel> >(_service.Find(predicate))); }
public IEnumerable <TEntity> Find(Expression <Func <TEntity, bool> > predicate) { return(_application.Find(predicate)); }
public IList <TEntity> Find(Func <TEntity, bool> lista) { return(_service.Find(lista)); }
public IEnumerable <TEntity> Find(Expression <Func <TEntity, bool> > predicate) { return(_repositorio.Find(predicate)); }
public async Task <T> Find(int id) { return(await _service.Find(id)); }
public TEntity Find(Expression <Func <TEntity, bool> > match) { return(_serviceBase.Find(match)); }
public List <TEntity> Find(System.Linq.Expressions.Expression <Func <TEntity, bool> > expression) => _serviceAppBase.Find(expression);
/// <summary> /// Edit Record /// </summary> /// <param name="Id"></param> /// <returns></returns> public virtual async Task <ActionResult> Edit(TKey Id) => View(await _service.Find(Id));
public TEntity Find(TEntity obj) { return(_serviceBase.Find(obj)); }
public TEntity Find(Expression <Func <TEntity, bool> > filter) { return(_serviceBase.Find(filter)); }
public IEnumerable <TEntity> Find(Func <TEntity, bool> expr) { return(_service.Find(expr)); }