public bool UpdateBundle(int bundleId, UpdateBundleDTO bundleToUpdate)
        {
            using (var db = new SqlConnection(_connectionString))
            {
                var sql = @"Update [Bundle]
                               SET [FlowerId] = @FlowerId
                               ,[PuppyId] = @PuppyId
                               ,[OccasionId] = @OccasionId
                               ,[Description] = @Description
                               ,[ProductImageUrl] = @ProductImageUrl
                            Where [Id] = @Id";

                bundleToUpdate.Id = bundleId;

                return(db.Execute(sql, bundleToUpdate) == 1);
            }
        }
Ejemplo n.º 2
0
 public IActionResult UpdateOrderBundleById(int bundleId, UpdateBundleDTO bundleToUpdate)
 {
     _repo.UpdateBundle(bundleId, bundleToUpdate);
     return(Ok());
 }