Exemplo n.º 1
0
        public async Task <IHttpActionResult> Post(AddToWishlist value)
        {
            try
            {
                IRepository <AddToWishlist> reposity = new Repository <AddToWishlist>();
                await reposity.CreateAsync(value);
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }

            return(Ok());
        }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> Get(string CookeId, string UserId, string ProductId, string ProductName, double Price)
        {
            try
            {
                IRepository <AddToWishlist> reposity = new Repository <AddToWishlist>();

                AddToWishlist item = new AddToWishlist()
                {
                    CookeId     = CookeId,
                    UserId      = UserId,
                    ProductId   = ProductId,
                    ProductName = ProductName,
                    Price       = Price
                };

                await reposity.CreateAsync(item);
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }

            return(Ok());
        }