Exemplo n.º 1
0
        public static object SetObjectLockoutEnd(this IObjectLockout lockout,
                                                 Func <object, object> newLockoutEndFactory)
        {
            lockout.NotNull(nameof(lockout));
            newLockoutEndFactory.NotNull(nameof(newLockoutEndFactory));

            var newLockoutEnd = lockout.GetObjectLockoutEnd();

            return(lockout.SetObjectLockoutEnd(newLockoutEndFactory.Invoke(newLockoutEnd)));
        }
Exemplo n.º 2
0
        public static async ValueTask <object> SetObjectLockoutEndAsync(this IObjectLockout lockout,
                                                                        Func <object, object> newLockoutEndFactory, CancellationToken cancellationToken = default)
        {
            lockout.NotNull(nameof(lockout));
            newLockoutEndFactory.NotNull(nameof(newLockoutEndFactory));

            var newLockoutEnd = await lockout.GetObjectLockoutEndAsync(cancellationToken).ConfigureAwait();

            return(await lockout.SetObjectLockoutEndAsync(newLockoutEndFactory.Invoke(newLockoutEnd), cancellationToken)
                   .ConfigureAwait());
        }