This file contains hidden or 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.Threading.Tasks; | |
using System.Net.Http; | |
private static HttpClient httpClient = new HttpClient(); | |
public static void Run(TimerInfo myTimer, ILogger log, out string outputBlob) | |
{ | |
var response = httpClient.GetAsync("http://api.openweathermap.org/data/2.5/weather?q=olsztyn,pl&APPID=4e61d7e7f40f9c3205722f24ebd3c2ac").Result; | |
outputBlob = response.Content.ReadAsStringAsync().Result; |
This file contains hidden or 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
# Starter pipeline | |
# Start with a minimal pipeline that you can customize to build and deploy your code. | |
# Add steps that build, run tests, deploy, and more: | |
# https://aka.ms/yaml | |
trigger: | |
- master | |
pool: | |
vmImage: 'ubuntu-latest' |
This file contains hidden or 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 DataContext : DbContext | |
{ | |
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
{ | |
optionsBuilder.UseSqlServer(@"Server=.\SQLEXPRESS;Database=EFCoreOptimisticConcurrency;Trusted_Connection=True;"); | |
} | |
public DbSet<Product> Products { get; set; } | |
} |
This file contains hidden or 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
<table class="table"> | |
<thead> | |
<tr> | |
<th>Date</th> | |
<th>Temp. (C)</th> | |
<th>Temp. (F)</th> | |
<th>Summary</th> | |
</tr> | |
</thead> | |
<tbody> |
This file contains hidden or 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
@page "/fetchdata" | |
@using BlazorPreRendering.Shared | |
@using BlazorPreRendering.Shared.Services | |
@inject IWeatherForecastService Service | |
<h1>Weather forecast</h1> | |
<p>This component demonstrates fetching data from the server.</p> | |
@if (forecasts == null) |
This file contains hidden or 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.Reflection | |
<Router AppAssembly="@typeof(Program).Assembly" | |
AdditionalAssemblies="@assemblies"> | |
<Found Context="routeData"> | |
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> | |
</Found> | |
<NotFound> | |
<LayoutView Layout="@typeof(MainLayout)"> | |
<p>Sorry, there's nothing at this address.</p> | |
</LayoutView> |
This file contains hidden or 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
Feature: Auth - fetching jwt token | |
Background: | |
* url baseUrl+"/api/Auth/Login" | |
Scenario: Featch jwt token | |
Given request {"Username":"#(userName)","Password":"#(password)"} | |
When method POST | |
Then status 200 | |
And match response contains { "message": "Success" } |
This file contains hidden or 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
static async Task ConsoleExample() | |
{ | |
var timeConstraint = TimeLimiter.GetFromMaxCountByInterval(5, TimeSpan.FromSeconds(1)); | |
for (int i = 0; i < 100; i++) | |
{ | |
await timeConstraint; | |
Console.WriteLine($"{DateTime.Now:MM/dd/yyy HH:mm:ss.fff}"); | |
} | |
} |
This file contains hidden or 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 async Task AddData() | |
{ | |
using (var db = new DataContext()) | |
{ | |
var project1 = new Project() | |
{ | |
Name = "project 1" | |
}; | |
await db.Projects.AddAsync(project1); |
This file contains hidden or 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 SendGridConfig | |
{ | |
public string ApiKey { get; set; } | |
public string SenderEmail { get; set; } | |
public string SenderName { get; set; } | |
} |