One column named Favorite(tinyint) in table of "Products" in sql server. I have generated entity it is converted into entity as looking like,
public class Products
{
----- Other Fields ------
public byte Favorite { get; set; }
}
I am trying to update entity as by given code below,
using (ADataContext dataContext = new ADataContext())
{
var product = dataContext.Products.Where(p => p.Id == 10).FirstOrDefault();
product.Favorite = (byte)EnumFavoriteType.MostFavorite;
dataContext.SubmitChanges();
}
It is not updating and showing error
"An exception of type 'System.Data.Linq.ChangeConflictException' occurred in 'A.Service.dll but was not handled in user code". "Row not found or changed."