Skip to content

Commit

Permalink
Move enum to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
liliankasem committed Jul 10, 2023
1 parent 9aae262 commit c99118d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private bool IsConverterFallbackAllowed(ConverterContext context)
{
if (result is not null && result is ConverterFallbackBehavior fallbackBehavior)
{
return fallbackBehavior == ConverterFallbackBehavior.Disallow ? false : true;
return fallbackBehavior != ConverterFallbackBehavior.Disallow;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

namespace Microsoft.Azure.Functions.Worker.Converters
{
/// <summary>
/// Specifies the fallback behavior for a converter.
/// The default behavior is <see cref="ConverterFallbackBehavior.Allow"/>.
/// </summary>
public enum ConverterFallbackBehavior
{
/// <summary>
/// Allows fallback to built-in converters. This is the default behavior.
/// </summary>
Allow = 0,

/// <summary>
/// Disallows fallback to built-in converters.
/// </summary>
Disallow = 1,

/// <summary>
/// Specifies the default fallback behavior as <see cref="ConverterFallbackBehavior.Allow"/>
/// </summary>
Default = Allow
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,4 @@ public ConverterFallbackBehaviorAttribute(ConverterFallbackBehavior fallbackBeha
Behavior = fallbackBehavior;
}
}

/// <summary>
/// Specifies the fallback behavior for a converter.
/// The default behavior is <see cref="ConverterFallbackBehavior.Allow"/>.
/// </summary>
public enum ConverterFallbackBehavior
{
/// <summary>
/// Allows fallback to built-in converters. This is the default behavior.
/// </summary>
Allow = 0,

/// <summary>
/// Disallows fallback to built-in converters.
/// </summary>
Disallow = 1,

/// <summary>
/// Specifies the default fallback behavior as <see cref="ConverterFallbackBehavior.Allow"/>
/// </summary>
Default = Allow
}
}

0 comments on commit c99118d

Please sign in to comment.