Пример #1
0
        /// <summary>
        /// Saves the changes made by the client.
        /// </summary>
        /// <param name="saveBundle">The changes to save.</param>
        /// <param name="configureAction">The save configuration action.</param>
        /// <returns>The save result.</returns>
        public SaveResult SaveChanges(SaveBundle saveBundle, Action <SaveChangesOptionsConfigurator> configureAction = null)
        {
            var configurator = new SaveChangesOptionsConfigurator();

            configureAction?.Invoke(configurator);

            return(SaveChanges(saveBundle, configurator.SaveChangesOptions));
        }
Пример #2
0
        /// <summary>
        /// Saves the changes made by the client, with an additional root model validation performed by the provided or default <see cref="IModelSaveValidator"/>.
        /// </summary>
        /// <typeparam name="TModel">The root model type.</typeparam>
        /// <param name="saveBundle">The changes to save.</param>
        /// <param name="configureAction">The save configuration action.</param>
        /// <returns>The save result.</returns>
        public SaveResult SaveChanges <TModel>(SaveBundle saveBundle, Action <SaveChangesOptionsConfigurator <TModel> > configureAction = null)
        {
            var configurator = new SaveChangesOptionsConfigurator <TModel>(_modelSaveValidatorProvider.Get(typeof(TModel)));

            configureAction?.Invoke(configurator);

            return(SaveChanges(saveBundle, configurator.SaveChangesOptions));
        }