How to create service of a procedure have no return type.
In Itableservices
void UpdateProductViews(int proId);
in tbaleservice
public void UpdateProductViews(int proId)
{
try
{
using (DbContext context = new saudiphonedbEntities())
{
context.Database.ExecuteSqlCommand("UpdateProductViews " + proId);
}
}
catch (Exception ex)
{
}
}
in controller
_productService.UpdateProductViews(productId);
Share This with your friend by choosing any social account