
.NetCore
yuxuac
这个作者很懒,什么都没留下…
展开
-
Some commands
------------New projects------------1. dotnet new classlib -n Infrastructure2. dotnet sln add Infrastructure3. dotnet add reference ../application/------------User secrets-------------1. Initia...原创 2020-02-12 12:04:50 · 180 阅读 · 0 评论 -
c# - entityframework core - switch databases
更换数据库之后,如果旧的Migrations导致数据库错误,可按照以下步骤重新生成Migrations:1. 删除所有existing migrations(包含:DataContextModelSnapshot), 直接文件删除就可以。2. 安装要更换数据库DataProvider的nuget package,例如:SqlServer的nuget package为:Microsoft.En...原创 2020-01-25 13:14:08 · 1600 阅读 · 0 评论 -
c# - Asp.net Core Identity - 操作步骤
1. Define a new class, derived from IdentityUserpublic class AppUser : IdentityUser { public string DisplayName { get; set; } }2. In your DataContext, change'public class DataCo...原创 2020-01-11 12:29:39 · 1476 阅读 · 0 评论 -
c# - Task again
using System;using System.Threading.Tasks;namespace TestTask{ class Program { static void Main(string[] args) { T1(); T2().Wait(); T3...原创 2020-01-11 12:01:28 · 317 阅读 · 0 评论 -
c# - CancellationToken Demo
using System;using System.Threading;using System.Threading.Tasks;namespace TaskCancellationTest{ class Program { static void Main(string[] args) { Cancellatio...原创 2020-01-05 12:30:21 · 498 阅读 · 0 评论 -
VSCode - Task.json同时Build多个Projects.
https://stackoverflow.com/questions/52238171/how-to-run-multiple-tasks-in-vs-code-on-build转载 2019-12-27 21:04:39 · 1536 阅读 · 0 评论 -
EntityFramwork Core - Reverse Engineering
基于Db Model->Update数据库Schema:应用migration1:1. 修改你的Db Model2. 执行:Add-Migration migration1 -Context "MyDbContext"3. 执行:Update-Database -Context "MyDbContext"撤销:migration11. 执行:Update-Database ‘...原创 2019-12-20 13:00:11 · 241 阅读 · 0 评论 -
Using .net core with Sqlite+password
1. 在.net framework下设置Sqlite密码,访问数据,重设密码,删除密码。using System;using System.Data.SQLite;namespace ConsoleApp1{ class Program { private const string password = "abc.123"; stat...原创 2019-12-20 12:37:51 · 1663 阅读 · 7 评论 -
Asp.net Core - Custom middleware
public class PrintSomethingMiddleware { private readonly RequestDelegate _next; public PrintSomethingMiddleware(RequestDelegate next) { _next = next; }...原创 2019-12-15 14:41:46 · 191 阅读 · 0 评论 -
Asp.net Core - File Logging
https://nblumhardt.com/2016/10/aspnet-core-file-logger/转载 2019-12-15 11:18:38 · 294 阅读 · 0 评论 -
c# - Getting Started with Entity Framework Core: Database-First Development
https://www.codeproject.com/Articles/1209903/Getting-Started-with-Entity-Framework-Core-Databas转载 2019-12-12 10:18:34 · 205 阅读 · 0 评论