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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFramework>netcoreapp3.1</TargetFramework> | |
<AssemblyName>Notifier.WebApi</AssemblyName> | |
<RootNamespace>Notifier.WebApi</RootNamespace> | |
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | |
<OutputType>Exe</OutputType> | |
<UserSecretsId>notifier-webapi-6fd34aeb-1b78-4492-86dd-a5aa00ce38cd</UserSecretsId> | |
</PropertyGroup> |
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
{ | |
"Logging": { | |
"LogLevel": { | |
"Default": "Information" | |
} | |
}, | |
"ApplicationInsights": { | |
"InstrumentationKey": "<OVERRIDE IN USERSECRETS>" | |
}, | |
"StorageSettings": { |
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
{ | |
"ApplicationInsightsSettings": { | |
"InstrumentationKey": "<INSTRUMENTATION_KEY_AZURE_PORTAL>" | |
}, | |
"AzureTableSettings": { | |
"ConnectionString": "<CONNECTION_STRING_AZURE_PORTAL>" | |
}, | |
"EventHubSettings": { | |
"ConnectionString": "<CONNECTION_STRING_AZURE_PORTAL>" | |
} |
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
using System; | |
namespace Notifier.WebApi.Models | |
{ | |
public class NotificationModel | |
{ | |
public string Message { get; set; } | |
public DateTime DateTime { get; set; } | |
} | |
} |
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
using Notifier.WebApi.Models; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Notifier.WebApi.Services | |
{ | |
public interface INotificationService | |
{ | |
Task CreateAndSendAsync(string message, CancellationToken cancellationToken); |
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
using Google.Protobuf; | |
using Microsoft.Azure.EventHubs; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Options; | |
using Notifier.Common; | |
using Notifier.Common.Settings; | |
using Notifier.WebApi.Common.Data; | |
using Notifier.WebApi.Common.Data.Entities; | |
using Notifier.WebApi.Models; | |
using System; |
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
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Routing; | |
using Microsoft.Extensions.Logging; | |
using Notifier.WebApi.Models; | |
using Notifier.WebApi.Services; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Notifier.WebApi.Controllers | |
{ |
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
using System.Net; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Logging.ApplicationInsights; | |
using Notifier.Common.Extensions; | |
using Notifier.Common.Settings; |
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
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
using Newtonsoft.Json.Converters; | |
using Notifier.Common.Extensions; | |
using Notifier.Common.Settings; | |
using Notifier.WebApi.Common.Data; | |
using Notifier.WebApi.Common.Data.Entities; |
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
GET http://localhost:8080/api/notifications | |
### | |
POST http://localhost:8080/api/notifications?message=hello this is my message |
OlderNewer