usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;namespaceMyGeneirc{internalclassProgram{staticvoidMain(string[] args){try{People people =newPeople(){ Id =123, Name ="张三"};Chinese chinese =newChinese(){ Id =234, Name ="李四"};Hubei hubei =newHubei(){ Id =456, Name ="王五"};Japanese japanese =newJapanese(){ Id =678, Name ="田中"};
Console.WriteLine("****************约束基类***********************");//Constraint.Show<People>(people);
Constraint.Show<Chinese>(chinese);
Constraint.Show<Hubei>(hubei);//Constraint.Show<Japanese>(japanese); // 编译报错
Console.WriteLine("****************约束接口***********************");
Constraint.Get<Chinese>(chinese);}catch(Exception ex){
Console.WriteLine(ex.ToString());}
Console.ReadLine();}}}
原生数据库使用 导入模块:go get -u github.com/go-sql-driver/mysql 安装 mysql 数据库 安装数据库可能遇到的问题:(网上的方法基本可以解决) ERROR 1045 (28000): Access denied for user ‘-root’‘localhost’ (using passwo…