-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor deferred binding attributes (#1723)
- Loading branch information
1 parent
f67098d
commit 0995527
Showing
18 changed files
with
138 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
src/DotNetWorker.Core/Converters/Converter/AllowConverterFallbackAttribute.cs
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
src/DotNetWorker.Core/Converters/Converter/ConverterFallbackBehavior.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
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 | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/DotNetWorker.Core/Converters/Converter/ConverterFallbackBehaviorAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace Microsoft.Azure.Functions.Worker.Converters | ||
{ | ||
/// <summary> | ||
/// An attribute that specifies if converter fallback is allowed or disallowed. | ||
/// Converter fallback refers to the ability to use built-in converters when custom converters | ||
/// cannot handle a given request. | ||
/// The default converter fallback behavior is <see cref="ConverterFallbackBehavior.Allow"/>. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Class)] | ||
public sealed class ConverterFallbackBehaviorAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// Gets the value of the converter fallback behavior. | ||
/// </summary> | ||
public ConverterFallbackBehavior Behavior { get; } | ||
|
||
/// <summary> | ||
/// Creates a new instance of <see cref="ConverterFallbackBehaviorAttribute"/> | ||
/// </summary> | ||
/// <param name="fallbackBehavior">The value to indicate if converter fallback is allowed or disallowed.</param> | ||
public ConverterFallbackBehaviorAttribute(ConverterFallbackBehavior fallbackBehavior) | ||
{ | ||
Behavior = fallbackBehavior; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
src/DotNetWorker.Core/Converters/Converter/SupportedConverterType.cs
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
src/DotNetWorker.Core/Converters/Converter/SupportedTargetTypeAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace Microsoft.Azure.Functions.Worker.Converters | ||
{ | ||
/// <summary> | ||
/// An attribute that can specify a target type supported by function input conversion. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] | ||
public sealed class SupportedTargetTypeAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// Gets the input converter supported target type. | ||
/// </summary> | ||
public Type TargetType { get; } | ||
|
||
/// <summary> | ||
/// Creates a new instance of <see cref="SupportedTargetTypeAttribute"/> | ||
/// </summary> | ||
/// <param name="targetType">Input converter target type.</param> | ||
/// <exception cref="ArgumentNullException">Thrown when type is null</exception> | ||
public SupportedTargetTypeAttribute(Type targetType) | ||
{ | ||
TargetType = targetType ?? throw new ArgumentNullException(nameof(targetType)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.