public IHttpActionResult GetProductType(RequestGetProductType request) { var tokenResult = IdentityValid.ValidateToken(request.Token); if (!tokenResult.IsSuccess) { return(Json(tokenResult)); } var bll = new ProductTypeBLL(); var entity = bll.LoadAll(o => o.UserName == tokenResult.userName); //if (request.ParentProductTypeId > 0) //{ // entity = entity.Where(o => o.ParentProductTypeId == request.ParentProductTypeId); //} return(Json <List <ProductType> >(entity.ToList())); }