I am creating a plug-in in Nopcommerce and have created a database table using my plugin.
In that plug-in I have used GetListByProductId(int id) & InsertItem(Item item) methods in services.
I have implemented these methods like below:
public void InsertItem(itemList item)
{
if (item == null)
{
throw new ArgumentNullException("itemlist");
}
//Persist
_itemlistRepository.Insert(item);
}
public virtual ItemList GetListByProductid(int ProductId)
{
if (ProductId <= 0) return null;
return _itemlistRepository.GetById(ProductId);
}
But I am getting the error, “The model backing the 'ItemObjectContext' context has changed since the database was created”.
I don't understand why this error happens and from where.
Can anyone help me solve this problem?
All answers are accepted.
Thanks in anticipation.