Hi all i have a Entity model ProdcutTable in my MVC4 WebApi application which has the following column names
[ProductID] [ProductName] [ProductDescritpion] [Price] [ImageURL] and so on
now i have to pass the price range as parameters
example
frstvale=$200
SecoundVal=$500
i have to retrive the [ProductID] [ProductName] [ProductDescritpion] [Price] [ImageURL] from the ProdcutTable for the selected price range how can i write the linq query for this at present i am retrieving all images from the table via a ajax call now i have to pass the paramaters for the price to my method and retrieve the records for the selected price range can any one help in writing the query for this
this is my model
public class Products
{
public int ProductID { get; set; }
public string ProductName{get;set;}
public string ProductDescription { get; set; }
public string ProductColor { get; set;}
public string ProductSize { get; set; }
public string Brand { get; set; }
public int Price { get; set; }
public string Department { get; set; }
public string ImageURL { get; set; }
public string DetailsURL { get; set; }
public string Gender { get; set; }
public string Firstvalue { get; set; }
public string Lastvalue { get; set; }
}
this is how i am retrieving all my images
private ProductsEntities products = new ProductsEntities();
public IEnumerable<ProductTable> GetAllProdcuts()
{
return products.ProductTables.AsEnumerable();
}
you can use
Whereextension method that takes an expression as parameter to filter out the return objects.