public class A { public int Property1 { get; set; } } static void Main(){ A aa = new A(); Type type = aa.GetType();//获取类型 System.Reflection.PropertyInfo propertyInfo = type.GetProperty("Property1"); propertyInfo.SetValue(aa, , null);//给对应属性赋值 in…
假设Node和npm已经安装 npm install -g @servicestack/cli 执行命令dotnet-new selfhost SSHost 这样就创建了ServiceStack的控制台程序,用VS2017解决方案,添加如下代码 using Funq; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; u…