This essay focuses on exception if corresponding checkout.Update row in Checkouts table that corresponds to the last checkout using the following rules:
/// a. successful check-
Create new row in Checkouts table using the following rules:
/// a. throw exception if user already has this video checked out
/// b. throw exception if TotalCopies value is 0
/// c. throw exception if videoId does not exist
/// d. throw exception if userId does not exist
/// e. successful checkout should decrement TotalCopies value
/// f. throw exception if video is deleted
/// </summary>
void CheckOutVideo(int videoId, Guid userId);
/// <summary>
/// Update row in Checkouts table that corresponds to the last checkout using the following rules:
/// a. successful check-in should increment TotalCopies value
/// b. throw exception if corresponding checkout is not found
/// c. throw exception if videoId does not exist
/// d. throw exception if userId does not exist
/// </summary>
void CheckInVideo(int videoId, Guid userId);
Details;
firstly, /// <summary>
secondly, /// Add new row to the Reviews table using the following rules:
Thirdly, /// a. user can create multiple reviews
Further, /// b. throw exception if videoId does not exist
Further, /// c. throw exception if userId does not exist
Lastly, /// d. throw exception if reviewText is null or empty
Lastly, /// e. throw exception if video is deleted
finally, /// </summary>
finally /// <returns>Integer representing ReviewID</returns>
int AddReview(int videoId, Guid userId, string reviewText);
/// <summary>
/// Update existing row in the Reviews table using the following rules:
/// a. throw exception if reviewId does not exist
/// b. throw exception if reviewText is null or empty
/// </summary>
void UpdateReview(int reviewId, string reviewText);
/// <summary>
/// Add new or update existing row in the Ratings table using the following