Any Help is much appreciated guys!
under GetProductByID, i am getting an error saying "int does not contain a definition for FirstOrDefault".
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using HomebaseSystemNew.Models;
namespace HomebaseSystemNew.Controllers
{
public class ProductRepository
{
public ProductsController GetProductID(int Pid)
{
Product db = new Product();
return db.Pid.FirstOrDefault(db => db.Pid == Pid);
}
}
}
Also You need to add using System.Linq namespace to access those methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With