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

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


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM