摘要: WebAPI 安全认证 阅读全文
posted @ 2020-11-05 23:39 丹心石 阅读(292) 评论(0) 推荐(0)
摘要: 之前用Ninject,最近因工作需要开始研究Autofac,其实两者都差不多,只是实现方法上有些区别,原理都一样,下面总结一下基础知识。 Autofac是一款IOC框架,它很轻量级性能非常高。(先吹捧一下,提高学习积极性) 控制反转(IOC Inverse of Control) 调用者不再创建被调 阅读全文
posted @ 2020-11-04 14:56 丹心石 阅读(209) 评论(0) 推荐(0)
摘要: 省略接口和类的实现,具体如上图: using Autofac;using System;using System.Linq;using System.Reflection;namespace autofacBatchResolver{ class Program { static void Main 阅读全文
posted @ 2020-11-04 14:09 丹心石 阅读(1041) 评论(0) 推荐(0)
摘要: 1.创建一个控制台项目 AutofacConsole 2.创建文件夹Abstract,在文件夹中创建接口 namespace AutofacConsole.Abstract{ public interface IDatabase { string Name { get; } void Select( 阅读全文
posted @ 2020-11-04 10:39 丹心石 阅读(297) 评论(0) 推荐(0)
摘要: 1.首先创建一个类库,用于创建模型 Contact using System; namespace Common{ public class Contact { public string Id { get; set; } public string Name { get; set; } publi 阅读全文
posted @ 2020-10-30 17:03 丹心石 阅读(258) 评论(0) 推荐(0)
摘要: AutoFac 阅读全文
posted @ 2020-10-29 11:08 丹心石 阅读(253) 评论(0) 推荐(0)
摘要: MySql EF 阅读全文
posted @ 2020-10-25 22:03 丹心石 阅读(838) 评论(0) 推荐(0)
摘要: 1.启动顺寻 public class program{ public static void Main(string[] args) CreateWebHostBuilder(args).Build().Run(); } public static IWebHostBuilder CreateWe 阅读全文
posted @ 2020-10-15 21:44 丹心石 阅读(315) 评论(0) 推荐(0)
摘要: 简单的认证设置: 1.在Web.config配置文件中增加 <authentication mode="Forms"> <forms loginUrl="~/Account/Login" timeout="2880"> <credentials passwordFormat="Clear"> <us 阅读全文
posted @ 2020-10-07 14:11 丹心石 阅读(125) 评论(0) 推荐(0)
摘要: <div ng-app="" ng-init="firstname='John'"> <p>名字:<input type="text" ng-model="name"></p> <h1> hello {{name}}</h1> <p ng-bind="name"></p> <p><span ng-b 阅读全文
posted @ 2020-09-29 13:45 丹心石 阅读(77) 评论(0) 推荐(0)