How to create service of a procedure have no return type.

  By Zaif Ullah   Posted on September-22-2018   685

.Net

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);

By  zaifullah489-000001    22-Sep-2018 Views  685



You may also read following recent Post

Item Image
What are 3 C
 221
Item Image
what is .net
 452