public IActionResult Get() { ListAllProducts listAllProducts = new ListAllProducts(); var result = _broker.Execute(listAllProducts); return(Ok(result)); //return Ok(new ListProductsResponse { Products = result }); }
public IEnumerable <ProductProxy> Handle(ListAllProducts query) { List <ProductProxy> Products = new List <ProductProxy>(); var nquery = "SELECT EntityId,ProductTypeId, Name, Description, CreatedBy,CreatedOn from Product Where TenantId ='" + _securityContext.TenantId.ToString() + "' AND EntityTypeId='" + EntityContext.Plan.ToString() + "'"; var request = new QueryRequest(nquery); var result = _repository.QueryDocuments(request); foreach (var row in result.Rows) { Products.Add(JsonConvert.DeserializeObject <ProductProxy>(JsonConvert.SerializeObject(row))); } return(Products); }
IEnumerable <ProductProxy> IQueryHandler <ListAllProducts, IEnumerable <ProductProxy> > .Handle(ListAllProducts query) { throw new System.NotImplementedException(); }