forked from dddwa/ddd-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to GA version of Azure Functions 2.0
- Loading branch information
Showing
31 changed files
with
182 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.WindowsAzure.Storage.Table; | ||
|
||
namespace DDD.Core.AppInsights | ||
{ | ||
public class AppInsightsVotingUser : TableEntity | ||
{ | ||
public AppInsightsVotingUser() { } | ||
|
||
public AppInsightsVotingUser(string conferenceInstance, string userId, string voteId, string startTime) | ||
{ | ||
PartitionKey = conferenceInstance; | ||
RowKey = Guid.NewGuid().ToString(); | ||
UserId = userId; | ||
VoteId = voteId; | ||
StartTime = startTime; | ||
} | ||
|
||
public string UserId { get; set; } | ||
public string VoteId { get; set; } | ||
public string StartTime { get; set; } | ||
} | ||
|
||
public class AppInsightsVotingUserComparer : IEqualityComparer<AppInsightsVotingUser> | ||
{ | ||
public bool Equals(AppInsightsVotingUser x, AppInsightsVotingUser y) | ||
{ | ||
return x.UserId == y.UserId && x.VoteId == y.VoteId; | ||
} | ||
|
||
public int GetHashCode(AppInsightsVotingUser obj) | ||
{ | ||
return (obj.UserId + "|" + obj.VoteId).GetHashCode(); | ||
} | ||
} | ||
} |
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,19 @@ | ||
using Microsoft.WindowsAzure.Storage.Table; | ||
|
||
namespace DDD.Core.Eventbrite | ||
{ | ||
public class EventbriteOrder : TableEntity | ||
{ | ||
public EventbriteOrder() | ||
{ | ||
} | ||
|
||
public EventbriteOrder(string conferenceInstance, string orderNumber) | ||
{ | ||
PartitionKey = conferenceInstance; | ||
RowKey = orderNumber; | ||
} | ||
|
||
public string OrderId => RowKey; | ||
} | ||
} |
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,45 @@ | ||
using System; | ||
using Microsoft.WindowsAzure.Storage.Table; | ||
using Newtonsoft.Json; | ||
|
||
namespace DDD.Core.Voting | ||
{ | ||
public class Vote : TableEntity | ||
{ | ||
public Vote() { } | ||
|
||
public Vote(string conferenceInstance, Guid voteId, string[] sessionIds, int[] indices, string ticketNumber, string ipAddress, string voterSessionId, DateTimeOffset votingStartTime, DateTimeOffset votingSubmittedTime) | ||
{ | ||
PartitionKey = conferenceInstance; | ||
RowKey = voteId.ToString(); | ||
SessionIds = JsonConvert.SerializeObject(sessionIds); | ||
Indices = JsonConvert.SerializeObject(indices); | ||
TicketNumber = ticketNumber; | ||
IpAddress = ipAddress; | ||
VoterSessionId = voterSessionId; | ||
VotingStartTime = votingStartTime; | ||
VotingSubmittedTime = votingSubmittedTime; | ||
} | ||
|
||
public string SessionIds { get; set; } | ||
|
||
public string[] GetSessionIds() | ||
{ | ||
return JsonConvert.DeserializeObject<string[]>(SessionIds); | ||
} | ||
|
||
public string Indices { get; set; } | ||
|
||
public string[] GetIndices() | ||
{ | ||
return JsonConvert.DeserializeObject<string[]>(Indices); | ||
} | ||
|
||
public string TicketNumber { get; set; } | ||
public string IpAddress { get; set; } | ||
public string VoterSessionId { get; set; } | ||
public DateTimeOffset VotingStartTime { get; set; } | ||
public DateTimeOffset VotingSubmittedTime { get; set; } | ||
public string VoteId => RowKey; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="microsoft.net.sdk.functions" Version="1.0.22" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\DDD.Core\DDD.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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
5 changes: 4 additions & 1 deletion
5
DDD.Functions/Config/SessionData.cs → DDD.Functions.Extensions/SessionData.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Linq; | ||
using DDD.Functions.Extensions; | ||
using Microsoft.Azure.WebJobs; | ||
using Microsoft.Azure.WebJobs.Host.Config; | ||
using Microsoft.Azure.WebJobs.Hosting; | ||
|
||
[assembly: WebJobsStartup(typeof(Startup))] | ||
|
||
namespace DDD.Functions.Extensions | ||
{ | ||
public class Startup : IWebJobsStartup | ||
{ | ||
public void Configure(IWebJobsBuilder builder) | ||
{ | ||
typeof(ConferenceConfig).Assembly.GetTypes() | ||
.Where(t => typeof(IExtensionConfigProvider).IsAssignableFrom(t)) | ||
.ToList() | ||
.ForEach(t => builder.AddExtension(t)); | ||
} | ||
} | ||
} |
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
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.