/// <summary> /// Validates a model. /// </summary> /// <param name="model"> /// The model. /// </param> /// <returns> /// The result of the validation. /// </returns> protected virtual bool ValidateModel(ICheckoutModel model) { var context = new ValidationContext(model, serviceProvider: null, items: null); var results = new List <ValidationResult>(); return(Validator.TryValidateObject(model, context, results, true)); }
/// <summary> /// Validates a model. /// </summary> /// <param name="model"> /// The model. /// </param> /// <returns> /// The result of the validation. /// </returns> protected virtual bool ValidateModel(ICheckoutModel model) { var context = new ValidationContext(model, serviceProvider: null, items: null); var results = new List<ValidationResult>(); return Validator.TryValidateObject(model, context, results, true); }
public ItemSQLConnections(IMemberModel memberModel, IItemModel itemModel, ICheckoutModel checkoutModel) { _memberModel = memberModel; _itemModel = itemModel; _checkoutModel = checkoutModel; }