-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
282 changed files
with
7,740 additions
and
4,642 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
Large diffs are not rendered by default.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
samples/Aliencube.AzureFunctions.FunctionApp.Functions/AddDummyFunction.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,54 @@ | ||
#if NET461 | ||
using System; | ||
using System.Net; | ||
using System.Net.Http; | ||
#endif | ||
|
||
using System.Threading.Tasks; | ||
|
||
using Aliencube.AzureFunctions.Extensions.DependencyInjection.Abstractions; | ||
using Aliencube.AzureFunctions.FunctionApp.Services; | ||
|
||
#if !NET461 | ||
using Microsoft.AspNetCore.Mvc; | ||
#endif | ||
|
||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Aliencube.AzureFunctions.FunctionApp.Functions | ||
{ | ||
/// <summary> | ||
/// This represents the function entity for sample HTTP trigger. | ||
/// </summary> | ||
public class AddDummyFunction : FunctionBase<ILogger>, IAddDummyFunction | ||
{ | ||
private readonly IDummyHttpService _service; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="AddDummyFunction"/> class. | ||
/// </summary> | ||
/// <param name="dependency"><see cref="IDummyHttpService"/> instance.</param> | ||
public AddDummyFunction(IDummyHttpService service) | ||
{ | ||
this._service = service; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override async Task<TOutput> InvokeAsync<TInput, TOutput>(TInput input, FunctionOptionsBase options = null) | ||
{ | ||
this.Log.LogInformation("C# HTTP trigger function processed a request."); | ||
|
||
var content = await this._service.AddDummy().ConfigureAwait(false); | ||
#if NET461 | ||
var req = input as HttpRequestMessage; | ||
var result = req.CreateResponse(HttpStatusCode.OK, content); | ||
|
||
return (TOutput)Convert.ChangeType(result, typeof(TOutput)); | ||
#elif NETSTANDARD2_0 | ||
var result = new OkObjectResult(content); | ||
|
||
return (TOutput)(IActionResult)result; | ||
#endif | ||
} | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
samples/Aliencube.AzureFunctions.FunctionApp.Functions/IGetDummiesFunction.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,13 @@ | ||
using Aliencube.AzureFunctions.Extensions.DependencyInjection.Abstractions; | ||
|
||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Aliencube.AzureFunctions.FunctionApp.Functions | ||
{ | ||
/// <summary> | ||
/// This provides interfaces to <see cref="GetDummiesFunction"/>. | ||
/// </summary> | ||
public interface IGetDummiesFunction : IFunction<ILogger> | ||
{ | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...cube.AzureFunctions.FunctionApp.Models/Aliencube.AzureFunctions.FunctionApp.Models.csproj
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Aliencube.AzureFunctions.Extensions.OpenApi\Aliencube.AzureFunctions.Extensions.OpenApi.csproj" /> | ||
<ProjectReference Include="..\..\src\Aliencube.AzureFunctions.Extensions.OpenApi.Core\Aliencube.AzureFunctions.Extensions.OpenApi.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
12 changes: 12 additions & 0 deletions
12
samples/Aliencube.AzureFunctions.FunctionApp.Models/DummyArrayResponseModel.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,12 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Aliencube.AzureFunctions.FunctionApp.Models | ||
{ | ||
public class DummyArrayResponseModel | ||
{ | ||
public string Id { get; set; } | ||
|
||
[JsonRequired] | ||
public string JsonRequiredValue { get; set; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
samples/Aliencube.AzureFunctions.FunctionApp.Models/DummyDictionaryResponseModel.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,14 @@ | ||
using System; | ||
|
||
using Newtonsoft.Json; | ||
|
||
namespace Aliencube.AzureFunctions.FunctionApp.Models | ||
{ | ||
public class DummyDictionaryResponseModel | ||
{ | ||
public Guid? Id { get; set; } | ||
|
||
[JsonRequired] | ||
public string JsonRequiredValue { get; set; } | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
samples/Aliencube.AzureFunctions.FunctionApp.Models/DummyRecursiveResponseModel.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,9 @@ | ||
namespace Aliencube.AzureFunctions.FunctionApp.Models | ||
{ | ||
public class DummyRecursiveResponseModel | ||
{ | ||
public string Id { get; set; } | ||
|
||
public DummyRecursiveResponseModel RecursiveValue { get; set; } | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
samples/Aliencube.AzureFunctions.FunctionApp.Models/DummyRequestModel.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,37 @@ | ||
using System; | ||
|
||
namespace Aliencube.AzureFunctions.FunctionApp.Models | ||
{ | ||
public class DummyRequestModel | ||
{ | ||
public Guid Id { get; set; } | ||
|
||
public short ShortValue { get; set; } | ||
|
||
public int IntValue { get; set; } | ||
|
||
public long LongValue { get; set; } | ||
|
||
public float SingleValue { get; set; } | ||
|
||
public double DoubleValue { get; set; } | ||
|
||
public decimal DecimalValue { get; set; } | ||
|
||
public int? NullableIntValue { get; set; } | ||
|
||
public bool BoolValue { get; set; } | ||
|
||
public ShortEnum ShortEnumValue { get; set; } | ||
|
||
public IntEnum IntEnumValue { get; set; } | ||
|
||
public LongEnum LongEnumValue { get; set; } | ||
|
||
public StringEnum StringEnumValue { get; set; } | ||
|
||
public DateTime DateTimeValue { get; set; } | ||
|
||
public DateTimeOffset DateTimeOffsetValue { get; set; } | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
samples/Aliencube.AzureFunctions.FunctionApp.Models/DummyResponseModel.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,50 @@ | ||
using System.Collections.Generic; | ||
|
||
using Aliencube.AzureFunctions.Extensions.OpenApi.Core.Attributes; | ||
using Aliencube.AzureFunctions.Extensions.OpenApi.Core.Enums; | ||
|
||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace Aliencube.AzureFunctions.FunctionApp.Models | ||
{ | ||
public class DummyResponseModel | ||
{ | ||
public DummySubResponseModel SubObjectValue { get; set; } | ||
|
||
public DummyRecursiveResponseModel RecursiveObjectValue { get; set; } | ||
|
||
public IDictionary<string, string> DictionaryStringValue { get; set; } | ||
|
||
public Dictionary<string, int> DictionaryIntValue { get; set; } | ||
|
||
public Dictionary<string, DummyDictionaryResponseModel> DictionaryObjectValue { get; set; } | ||
|
||
public IList<string> ListStringValue { get; set; } | ||
|
||
public List<int> ListIntValue { get; set; } | ||
|
||
public List<DummyArrayResponseModel> ListObjectValue { get; set; } | ||
|
||
public DummyArrayResponseModel[] ArrayObjectValue { get; set; } | ||
|
||
public JObject JObjectValue { get; set; } | ||
|
||
public JToken JTokenValue { get; set; } | ||
|
||
[JsonProperty("CapitalisedJsonPropertyValue")] | ||
public string JsonPropertyValue { get; set; } | ||
|
||
[JsonIgnore] | ||
public string JsonIgnoreValue { get; set; } | ||
|
||
[JsonProperty("CapitalisedJsonPropertyRequiredValue", Required = Required.DisallowNull)] | ||
public string JsonPropertyRequiredValue { get; set; } = "hello world"; | ||
|
||
[JsonRequired] | ||
public string JsonRequiredValue { get; set; } = "lorem ipsum"; | ||
|
||
[OpenApiSchemaVisibility(OpenApiVisibilityType.Advanced)] | ||
public string OpenApiSchemaVisibilityValue { get; set; } | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
samples/Aliencube.AzureFunctions.FunctionApp.Models/DummySubResponseModel.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,12 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Aliencube.AzureFunctions.FunctionApp.Models | ||
{ | ||
public class DummySubResponseModel | ||
{ | ||
public int Id { get; set; } | ||
|
||
[JsonProperty("CapitalisedJsonRequiredValue", Required = Required.Always)] | ||
public string JsonRequiredValue { get; set; } | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
samples/Aliencube.AzureFunctions.FunctionApp.Models/IntEnum.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,8 @@ | ||
namespace Aliencube.AzureFunctions.FunctionApp.Models | ||
{ | ||
public enum IntEnum | ||
{ | ||
Value1, | ||
Value2 | ||
} | ||
} |
Oops, something went wrong.