摘要:
1.add service to provider (need nuget a package before add this service) services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies()); 2.create a m 阅读全文
摘要:
docker git init git clone //You should enter the folder which have a ".gitigore" file and copy files which you want to git push for your repository in 阅读全文
摘要:
一、tmux tmux比nohup方便,建议使用tmux。 先安装tmux:sudo apt-get install tmux 然后用命令:tmux new -s session_name 新开一个会话 在会话里启动进程后,回到原本界面的方法: 先按下ctrl+b,然后再单独按d 此时会话里的进程仍 阅读全文
摘要:
Post 从body提交(json或其他格式) [HttpPost] public async Task<ActionResult<CompanyDto>> CreateCompany([FromBody] CompanyAddDto companyAddDto) { var entity = _m 阅读全文
摘要:
Post(位置:Body) 主要是创建资源,添加资源 Get(可含查询字符串,QueryString添加自定义查询参数) 主要是获取资源 获取符合条件的资源 Delete(可含查询字符串,QueryString添加自定义查询参数) 删除>无需返回 Patch(资源局部进行更新)(位置:Body) 更 阅读全文
摘要:
一、WebApi launchSetting.json 没用的都删掉 { "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { "webApi": { "commandName": "Project", 阅读全文
摘要:
网上的示例大部分都过时了 这个是最新的 //重置此用户令牌 var token = await_userManager.GeneratePasswordResetTokenAsync(user); //更新密码 await _userManager.ResetPasswordAsync(user,t 阅读全文
摘要:
//当返回404代码的时候定向到登录页面 app.UseStatusCodePages( async options =>{if (options.HttpContext.Response.StatusCode == 404) { options.HttpContext.Response.Redir 阅读全文
摘要:
先实现一个简单的异步方法:(这种方法是:非阻塞的,并行执行的) asyncRsult方法模拟一些异步操作; 执行到Task.run的时候会返回一个调用者; 在主方法中创建一个等待接受任务结果的对象; 用对象的OnCompleted方法内委托执行获取结果; 当然,这不是最简单的方法 最简单的方法是用关 阅读全文
摘要:
实体控制类 public class IdentityDbContext: Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<RegisterViewModel> { public IdentityDbContex 阅读全文