public static SyncForceClientPolicy GetSyncForceClientPolicy(CommerceContext context) { if (!context.HasPolicy <SyncForceClientPolicy>()) { throw new Exception("GetSyncForceClientPolicy could not find a SyncForceClientPolicy to be returned for API Connection"); } return(context.GetPolicy <SyncForceClientPolicy>()); }
/// <summary> /// Gets the profiles SQL connection policy. /// </summary> /// <param name="context">The context.</param> /// <returns> /// A <see cref="ProfilesSqlPolicy" /> /// </returns> public static ProfilesSqlPolicy GetProfilesSqlConnectionPolicy(CommerceContext context) { if (!context.HasPolicy <ProfilesSqlPolicy>()) { throw new Sitecore.Commerce.Core.CommerceException("GetProfilesSqlConnectionPolicy a ProfilesSqlPolicy to be returned for SQL Connection"); } return(context.GetPolicy <ProfilesSqlPolicy>()); }