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
| test |
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
| app.Use(async (context, next) => | |
| { | |
| // Do work that doesn't write to the Response. | |
| await next.Invoke(); | |
| // Do logging or other work that doesn't write to the Response. | |
| }); |
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
| namespace webapi1.Repositories | |
| { | |
| public interface IUserRepository | |
| { | |
| string GetByID(int id); | |
| } | |
| public class UserRepository: IUserRepository | |
| { | |
| public string GetByID(int id) |
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
| dotnet add package Swashbuckle.AspNetCore | |
| //namespace: | |
| using Swashbuckle.AspNetCore.Swagger; | |
| // w metodzie ConfigureServices | |
| // Register the Swagger generator, defining 1 or more Swagger documents | |
| services.AddSwaggerGen(c => | |
| { | |
| c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" }); |
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
| NLog | |
| NLog.Web.AspNetCore | |
| // w pliku .csproj | |
| <ItemGroup> | |
| <Content Update="nlog.config" CopyToOutputDirectory="PreserveNewest" /> | |
| </ItemGroup> | |
| // configuracja w pliku Porgram.cs |
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
| dotnet add package GlobalExceptionHandler | |
| dotnet restore | |
| using GlobalExceptionHandler.WebApi; | |
| using Microsoft.AspNetCore.Http; | |
| // do metody configure: | |
| // to powinno isc do else | |
| app.UseGlobalExceptionHandler(x => | |
| { |
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
| dotnet add package Microsoft.EntityFrameworkCore.SqlServer | |
| public class BloggingContext : DbContext | |
| { | |
| public DbSet<Blog> Blogs { get; set; } | |
| public DbSet<Post> Posts { get; set; } | |
| protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) |
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
| var express = require('express') | |
| var app = express() | |
| app.get('/', function (req, res) { | |
| res.send('Hello World') | |
| }) | |
| console.log('go'); | |
| app.listen(3000) |
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
| //styles.css | |
| @import url('https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css'); | |
| export function addNumbers (x: number, y: number): number { | |
| return x + y; | |
| } | |
| export class User { | |
| private name: string; |
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
| <!-- grid with two rows --> | |
| <div class="container"> | |
| <!-- navs component from boostrap --> | |
| <div class="row"> | |
| <div class="col-sm"> | |
| <ul class="nav"> | |
| <li class="nav-item"> | |
| <a class="nav-link active" routerLink="/list" routerLinkActive="active" >Lista browarow</a> | |
| </li> |
OlderNewer