本文整理汇总了C#中PaymentMethod.SaveChanges方法的典型用法代码示例。如果您正苦于以下问题:C# PaymentMethod.SaveChanges方法的具体用法?C# PaymentMethod.SaveChanges怎么用?C# PaymentMethod.SaveChanges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PaymentMethod
的用法示例。
在下文中一共展示了PaymentMethod.SaveChanges方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddPaymentMethod
/// <summary>
/// Adds a payment method for a specific language.
/// </summary>
/// <param name="id">The ID of the payment method.</param>
/// <param name="name">The name of the payment method.</param>
/// <param name="systemKeyword">The system name of the payment method.</param>
/// <param name="description">A description of the payment method.</param>
/// <param name="implementationClass"></param>
/// <param name="gatewayClass"></param>
/// <param name="isDefault">Indicate whether it should be the default method or not.</param>
/// <param name="orderIndex">The ordering index when the method is listed.</param>
/// <param name="markets">All markets the method should be associated with.</param>
/// <param name="language">The language for the payment method.</param>
/// <param name="paymentMethodDto">The dataset used for creating new payment method rows.</param>
private static void AddPaymentMethod(Guid id, string name, string systemKeyword, string description, string implementationClass, string gatewayClass,
bool isDefault, int orderIndex, IEnumerable<IMarket> markets, CultureInfo language, PaymentMethodDto paymentMethodDto)
{
var row = paymentMethodDto.PaymentMethod.AddPaymentMethodRow(id, name, description, language.TwoLetterISOLanguageName,
systemKeyword, true, isDefault, gatewayClass,
implementationClass, false, orderIndex, DateTime.Now, DateTime.Now, AppContext.Current.ApplicationId);
var paymentMethod = new PaymentMethod(row);
paymentMethod.MarketId.AddRange(markets.Where(x => x.IsEnabled && x.Languages.Contains(language)).Select(x => x.MarketId));
paymentMethod.SaveChanges();
}