Skip to content

Instantly share code, notes, and snippets.

@danielplawgo
danielplawgo / azure-pipelines.yml
Created August 26, 2019 04:18
Postman - uruchamianie testów w Azure DevOps
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.Repository.LocalPath)/Tests'
artifact: 'Tests'
@danielplawgo
danielplawgo / GetById.js
Created August 4, 2019 05:25
Postman - asserty w automatycznych testach
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
pm.test("Response time is less than 200ms", function () {
pm.expect(pm.response.responseTime).to.be.below(200);
});
pm.test("Return added product data", function () {
var jsonData = pm.response.json();
@danielplawgo
danielplawgo / program.cs
Created July 11, 2019 04:15
dotnet try test
class Program
{
static void Main(string[] args)
{
new OperationDemo().Run();
}
}
public class Expression
{
public string Operator { get; set; }
@danielplawgo
danielplawgo / Counter.razor
Created May 29, 2019 03:23
Blazor geek just join it
@page "/counter"
<h1>Counter</h1>
<p>Current count: @currentCount</p>
<button class="btn btn-primary" onclick="@IncrementCount">Click me</button>
@functions {
int currentCount = 0;
@danielplawgo
danielplawgo / FetchData.razor
Created May 28, 2019 04:18
Blazor JavaScript Interop
@page "/fetchdata"
@using CsvHelper
@using System.IO
@using System.Text
@inject IWeatherForecastService Service
@inject IFileService FileService
<h1>Weather forecast</h1>
<p>This component demonstrates fetching data from the server.</p>
@danielplawgo
danielplawgo / FetchData.razor
Created May 25, 2019 04:26
Blazor użycie Web API
@page "/fetchdata"
@inject IWeatherForecastService Service
<h1>Weather forecast</h1>
<p>This component demonstrates fetching data from the server.</p>
@if (forecasts == null)
{
<p><em>Loading...</em></p>
@danielplawgo
danielplawgo / CSharp1.cs
Created May 21, 2019 07:11
Nowy switch w C# 8.0
class OperationDemo
{
public void Run()
{
var expression = new Expression()
{
Arg1 = 10,
Arg2 = 5,
Operator = "/"
};
@danielplawgo
danielplawgo / WithCache.cs
Created March 29, 2019 05:19
Cache oraz Future z EF Plus
public class CacheDemo
{
public void Run()
{
WithCache();
}
private void WithCache()
{
using (var db = new DataContext())
@danielplawgo
danielplawgo / BaseModel.cs
Created March 25, 2019 07:25
Filtrowanie w Entity Framework Plus
public class BaseModel
{
public BaseModel()
{
IsActive = true;
}
public int Id { get; set; }
public bool IsActive { get; set; }
@danielplawgo
danielplawgo / Counter.cshtml
Created March 17, 2019 07:44
Blazor - frontend w C#
@page "/counter"
<h1>Counter</h1>
<p>Current count: @currentCount</p>
<button class="btn btn-primary" onclick="@IncrementCount">Click me</button>
@functions {
int currentCount = 0;