public async Task <IEnumerable <SearchTacitRespone> > SearchTacit(SearchTacitCommand request) { using (var connection = new SqlConnection(_repository.StrConnect)) { DynamicParameters inputParam = new DynamicParameters(new { LocationID = request.LocationId, BranchID = !string.IsNullOrWhiteSpace(request.BranchId) ? request.BranchId : "%", Code = !string.IsNullOrWhiteSpace(request.Code) ? request.Code : "%", InvestID = !string.IsNullOrWhiteSpace(request.InvestId) ? request.InvestId : "%", ManagerUnitID = !string.IsNullOrWhiteSpace(request.ManagetUnitId) ? request.ManagetUnitId : "%", TypeTacit = !string.IsNullOrWhiteSpace(request.TypeTacit) ? request.TypeTacit : "%" }); return(await connection.QueryAsync <SearchTacitRespone>("fpt_spSearch_Tacit", inputParam, commandType : CommandType.StoredProcedure)); } }
public async Task <ActionResult <IEnumerable <SearchTacitRespone> > > Search(SearchTacitCommand command) { return(Ok(await Mediator.Send(command))); }