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; | |
var builder = WebApplication.CreateBuilder(args); | |
// Add services to the container. | |
builder.Services.Configure<RouteHandlerOptions>(o => o.ThrowOnBadRequest = true); | |
var app = builder.Build(); | |
// middleware to check content-type header | |
app.Use(async (context, next) => |
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.IO; | |
using System.Threading.Tasks; | |
using System.Web.Http; | |
using System.Xml.Serialization; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Extensions.Http; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.Extensions.Logging; |
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
<!-- | |
* href="data:image/svg+xml,...": | |
Instead of linking to an external file, this code provides the image data directly inline using a data: URL. | |
image/svg+xml indicates that the data is an SVG image. | |
* The SVG (Scalable Vector Graphics) is an XML-based vector image format. | |
** viewBox=%220 0 100 100%22 - This SVG defines a simple image with a width and height of 100x100 units. | |
* The content of the SVG is a text representation of the clipboard emoji (📋). |
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
// check your functions version in .csproj | |
// check your function is out-of-process (assembly file) | |
<AzureFunctionsVersion>v4</AzureFunctionsVersion> | |
// install package | |
Install-Package Microsoft.AspNetCore.Mvc.NewtonsoftJson | |
// it will give you generic JsonResult | |
/// <summary> | |
/// Creates a new <see cref="JsonResult"/> with the given <paramref name="value"/>. |
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
// check your functions version in .csproj | |
// check your function is out-of-process (assembly file) | |
<AzureFunctionsVersion>v4</AzureFunctionsVersion> | |
// install package | |
Install-Package Microsoft.AspNetCore.Mvc.NewtonsoftJson | |
// provide startup class | |
[assembly: FunctionsStartup(typeof(Xakpc.FeedbackBots.Startup))] |
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
<div class = "clock"> | |
<h1>@Time</h1> | |
</div> |
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
curl -v -X PUT "https://bot.api.chat/v1/bots/botName/scenario" | |
-H "Content-Type: application/xml" | |
-H "Cache-Control: no-cache" | |
-H "Ocp-Apim-Subscription-Key: your-subscription-key" | |
--data-raw ' | |
<bot> | |
<states> | |
<state name="Start"> | |
<transition input="hello" next="Start">Hello from chatbot</transition> | |
<transition input="*" next="Start" morphology="msg">You send me {msg}</transition> |
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
/// <summary> | |
/// ComponentBase with DataContext | |
/// </summary> | |
public class ContextComponentBase : ComponentBase | |
{ | |
/// <summary> | |
/// | |
/// </summary> | |
protected ViewModelBase DataContext { 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
<div class="card @Class" @attributes="InputAttributes"> | |
@if (Title != null) | |
{ | |
<div class="card-header"> | |
<h5 class="card-title">@Title</h5> | |
</div> | |
} | |
<div class="card-body"> | |
@ChildContent | |
</div> |
NewerOlder