klasa DBContext
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.SqlServer;
using System;
using System.Collections.Generic;
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { NgModule } from '@angular/core'; | |
| import { FormsModule } from '@angular/forms'; | |
| import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; | |
| import { RouterModule } from '@angular/router'; | |
| import { AppComponent } from './app.component'; | |
| import { NavMenuComponent } from './nav-menu/nav-menu.component'; | |
| import { HomeComponent } from './home/home.component'; | |
| import { CounterComponent } from './counter/counter.component'; |
| <target name="database" xsi:type="Database"> | |
| <connectionString>server=localhost;Database=*****;user id=****;password=*****</connectionString> | |
| <!-- | |
| Script for creating the dbo.Log table. | |
| SET ANSI_NULLS ON | |
| SET QUOTED_IDENTIFIER ON | |
| CREATE TABLE [dbo].[Log] ( | |
| [Id] [int] IDENTITY(1,1) NOT NULL, |
| // w pliku html | |
| <div style="height: 600px;" | |
| leaflet | |
| [leafletOptions]="options"> | |
| </div> | |
| // w pliku .ts | |
| options = { | |
| layers: [ | |
| tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: '...' }) |
| using System; | |
| using System.Collections.Generic; | |
| using System.IdentityModel.Tokens.Jwt; | |
| using System.Security.Claims; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Microsoft.AspNetCore.Authorization; | |
| using Microsoft.AspNetCore.Identity; | |
| using Microsoft.AspNetCore.Mvc; | |
| using Microsoft.Extensions.Configuration; |
| private object GenerateJwtToken(string userName, CommandoUser user) | |
| { | |
| var claims = new List<Claim> | |
| { | |
| new Claim("username", userName), | |
| new Claim(JwtRegisteredClaimNames.Sub, userName), | |
| new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()), | |
| new Claim(ClaimTypes.NameIdentifier, user.UserName), | |
| new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", userName) | |
| }; |
| https://joonasw.net/view/apply-authz-by-default | |
| "JwtConfig":{ | |
| "JwtKey": "superSecretKey@123456", | |
| "JwtIssuer": "http://localhost:5000", | |
| "JwtExpireDays": 30 | |
| } | |
| VS Code | |
| Node 8.x | |
| a potem w kosoli: | |
| npm install -g yo gulp | |
| npm install -g @microsoft/generator-sharepoint | |
| npm install -g @pnp/generator-spfx |
| SET EX="C:\Program Files\IIS Express\iisexpress.exe" | |
| if not "%1" == "" ( | |
| CALL %EX% /path:%CD% /port:%1 | |
| ) else ( | |
| CALL %EX% /path:%CD% | |
| ) |