Пример #1
0
        public void AddCustomerReview(Provider provider, CustomerReview review)
        {
            using (var conn = DbContextFactory.CreateConnection())
            {
                // Add the customer review
                var newReview = conn.Add(review);

                // Then add the relationship to the provider
                conn.Execute("ProviderCustomerReview_Add", new
                {
                    ProviderId = provider.ProviderId,
                    CustomerReviewId = newReview.CustomerReviewId
                }, commandType: CommandType.StoredProcedure);
            }
        }
Пример #2
0
 public void UpdateProviderRating(Provider provider)
 {
     using (var conn = DbContextFactory.CreateConnection())
     {
         conn.Execute("Provider_UpdateRating",
             new
             {
                 ProviderId = provider.ProviderId,
                 Rating = provider.Rating,
                 User = provider.LastModifiedByUser
             },
             commandType: CommandType.StoredProcedure);
     }
 }