public IQueryable <TipoTelefone> GetByFilters(TipoTelefoneFilter filters) { var querybase = this.GetAll(); var queryFilter = this.SimpleFilters(filters, querybase); return(queryFilter); }
public async Task <IActionResult> Get([FromQuery] TipoTelefoneFilter filters) { var result = new HttpResult <TipoTelefoneDto>(this._logger, this._service); try { var searchResult = await this._service.GetByFiltersPaging(filters); return(result.ReturnCustomResponse(searchResult)); } catch (Exception ex) { return(result.ReturnCustomException(ex, "TipoTelefone", filters)); } }
public async Task <IActionResult> DataItems([FromQuery] TipoTelefoneFilter filters) { var result = new HttpResult <dynamic>(this._logger, this._service); try { var items = await this._service.GetDataItems(filters); return(result.ReturnCustomResponse(items)); } catch (Exception ex) { return(result.ReturnCustomException(ex, "Assinatura", filters)); } }
protected IQueryable <TipoTelefone> SimpleFilters(TipoTelefoneFilter filters, IQueryable <TipoTelefone> queryBase) { var queryFilter = queryBase; if (filters.TipoTelefoneId.IsSent()) { queryFilter = queryFilter.Where(_ => _.TipoTelefoneId == filters.TipoTelefoneId); } if (filters.Nome.IsSent()) { queryFilter = queryFilter.Where(_ => _.Nome.Contains(filters.Nome)); } return(queryFilter); }
public async Task <IActionResult> Get(int id, [FromQuery] TipoTelefoneFilter filters) { var result = new HttpResult <TipoTelefoneDto>(this._logger, this._service); try { filters.TipoTelefoneId = id; var returnModel = await this._service.GetById(filters); return(result.ReturnCustomResponse(returnModel)); } catch (Exception ex) { return(result.ReturnCustomException(ex, "TipoTelefone", id)); } }
public virtual IEnumerable <dynamic> GetDataItems(TipoTelefoneFilter filters) { var querybase = this.GetAll(); return(this.GetAll().Select(_ => new { Id = _.TipoTelefoneId, Name = _.Nome })); }
public TipoTelefone GetById(TipoTelefoneFilter filters) { var querybase = this.GetByFilters(filters); return(querybase.SingleOrDefault()); }