private async Task CustomSave()

in src/Epam.GraphQL/Loaders/MutableLoader.cs [533:562]


        private async Task CustomSave(IResolveFieldContext context, SaveResultItem<TEntity, TId> item, TEntity itemToUpdate)
        {
            var customProps = item.Properties.Keys
                .Where(propName =>
                {
                    var field = InputObjectGraphTypeConfigurator.FindFieldByName(propName);
                    return field.EditSettings != null && field.EditSettings.OnWrite != null && !field.EditSettings.IsReadOnly;
                });

            foreach (var propName in customProps)
            {
                var field = InputObjectGraphTypeConfigurator.FindFieldByName(propName);
                var value = item.Properties[propName];
                field.EditSettings!.OnWrite!(context, itemToUpdate, value);
            }

            customProps = item.Properties.Keys
                .Where(propName =>
                {
                    var field = InputObjectGraphTypeConfigurator.FindFieldByName(propName);
                    return field.EditSettings != null && field.EditSettings.OnWriteAsync != null && !field.EditSettings.IsReadOnly;
                });

            foreach (var propName in customProps)
            {
                var field = InputObjectGraphTypeConfigurator.FindFieldByName(propName);
                var value = item.Properties[propName];
                await field.EditSettings!.OnWriteAsync!(context, itemToUpdate, value).ConfigureAwait(false);
            }
        }