public SubscriptionInfo SubscriptionCreate(Guid? guid, string name, Guid requestingUserGuid)
{
guid = guid ?? Guid.NewGuid();
var result = Gateway.ExecuteNonQuery("Subscription_Create", new[]
{
new MySqlParameter("Guid", guid.Value.ToByteArray()),
new MySqlParameter("Name", name),
new MySqlParameter("RequestUserGuid", requestingUserGuid.ToByteArray())
});
if(result == -100) throw new InsufficientPermissionsException("User does not have sufficient permissions to access the subscription");
if(result == -200) throw new UnhandledException("Unhanded exception in Subscription_Create and was rolled back");
return SubscriptionGet(guid, requestingUserGuid).First();
}