Skip to content

Instantly share code, notes, and snippets.

View screamingworld's full-sized avatar

Markus Herkommer screamingworld

View GitHub Profile
<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>
{
"Logging": {
"LogLevel": {
"Default": "Information"
}
},
"ApplicationInsights": {
"InstrumentationKey": "<OVERRIDE IN USERSECRETS>"
},
"StorageSettings": {
{
"ApplicationInsightsSettings": {
"InstrumentationKey": "<INSTRUMENTATION_KEY_AZURE_PORTAL>"
},
"AzureTableSettings": {
"ConnectionString": "<CONNECTION_STRING_AZURE_PORTAL>"
},
"EventHubSettings": {
"ConnectionString": "<CONNECTION_STRING_AZURE_PORTAL>"
}
using System;
namespace Notifier.WebApi.Models
{
public class NotificationModel
{
public string Message { get; set; }
public DateTime DateTime { get; set; }
}
}
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);
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;
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
{
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;
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;
GET http://localhost:8080/api/notifications
###
POST http://localhost:8080/api/notifications?message=hello this is my message