var app = WebApplication.Create(args);
app.MapGet("/", () => "Hello World");
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
; Script generated by the Inno Setup Script Wizard. | |
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! | |
#define MyAppName "dotnet core windows service" | |
#define MyAppVersion "1.5" | |
#define MyAppPublisher "dotnetthoughts" | |
#define MyAppURL "http://dotnetthoughts.net/" | |
[Setup] | |
; NOTE: The value of AppId uniquely identifies this application. |
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
public class CSSIsolationActionFilterAttribute : ActionFilterAttribute | |
{ | |
public CSSIsolationActionFilterAttribute() | |
{ | |
} | |
public override void OnResultExecuted(ResultExecutedContext filterContext) | |
{ | |
ViewResult viewResult = filterContext.Result as ViewResult; | |
RazorView view = viewResult?.View as RazorView; |
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
{ | |
"showSecondCTA": true | |
} |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
using WebApp2.Middlewares; |
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
'use strict'; | |
const express = require('express'); | |
// Constants | |
const PORT = 8095; | |
const HOST = '0.0.0.0'; | |
// App | |
const app = express(); |
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
<#@ template debug="false" hostspecific="true" language="C#" #> | |
<#@ assembly name="System.Core" #> | |
<#@ assembly name="System.Xml" #> | |
<#@ assembly name="System.IO" #> | |
<#@ assembly name="System.Data" #> | |
<#@ assembly name="System.Configuration" #> | |
<#@ assembly name="Microsoft.SqlServer.ConnectionInfo" #> | |
<#@ assembly name="Microsoft.SqlServer.Smo" #> | |
<#@ assembly name="Microsoft.SqlServer.Management.Sdk.Sfc" #> |
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
private static readonly AzureKeyCredential Credentials = new AzureKeyCredential("KEY"); | |
private static readonly Uri Endpoint = new Uri("ENDPOINT"); | |
private static readonly string SearchApiKey = "KEY"; | |
private static readonly string BitlyKey = "KEY"; | |
private static readonly string TwitterConsumerKey = "CONSUMERKEY"; | |
private static readonly string TwitterConsumerSecret = "CONSUMERSECRET"; | |
private static readonly string TwitterAccessToken = "ACCESSTOKEN"; | |
private static readonly string TwitterAccessTokenSecret = "ACCESSTOKENSECRET"; | |
private static readonly string[] searchTerms = new[] { "Application Technology", "Architecture", | |
"Artificial Intelligence", "Open Source", "SAAS", "Business Transformation", |
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
//Add reference of Microsoft.Azure.CognitiveServices.Search.NewsSearch Package | |
using Microsoft.Azure.CognitiveServices.Search.NewsSearch; | |
public static async Task<News> GetSearchResults(string searchTerm) | |
{ | |
var searchClient = new NewsSearchClient(new ApiKeyServiceClientCredentials(SearchApiKey)); | |
return await searchClient.News.SearchAsync(query: searchTerm, market: "en-us", count: 5); | |
} |
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
//Add reference of Azure.AI.TextAnalytics | |
using Azure; | |
using Azure.AI.TextAnalytics; | |
using Microsoft.Azure.CognitiveServices.Search.NewsSearch.Models; | |
public static async Task<string> GetKeywords(string text) | |
{ | |
var client = new TextAnalyticsClient(Endpoint, Credentials); | |
var response = await client.ExtractKeyPhrasesAsync(text); | |
var tags = new List<string>(); |
NewerOlder