当前位置: 首页 > news >正文

wordpress邮箱验证配置文件长沙网站推广排名优化

wordpress邮箱验证配置文件,长沙网站推广排名优化,公司网站建设,网站建设高1、本文将使用SqlSugar创建Sqlite数据库,进行入门的增删改查等操作。擦,咋写着写着凌乱起来了。 SqlSugar官方文档:简单示例,1分钟入门 - SqlSugar 5x - .NET果糖网 2、环境SqlSugar V5.0版本需要.Net Framework 4.6 &#xff0…

1、本文将使用SqlSugar创建Sqlite数据库,进行入门的增删改查等操作。擦,咋写着写着凌乱起来了。

SqlSugar官方文档:简单示例,1分钟入门 - SqlSugar 5x - .NET果糖网

2、环境SqlSugar V5.0版本需要.Net Framework 4.6 ,NuGet添加内容如下,安装红框中的内容就可以了。这里的数据库demo.db是自动创建的。

3、运行效果如下图 。

4、整体代码如下。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;namespace ConsoleAppSqlSugar
{class Program{static void Main(string[] args){Console.WriteLine("启动");// 创建数据库对象SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig(){ConnectionString = "datasource=demo.db",DbType = DbType.Sqlite,IsAutoCloseConnection = true}, db =>{db.Aop.OnLogExecuting = (sql, pars) =>{//获取原生SQL推荐 5.1.4.63 性能OKConsole.WriteLine(UtilMethods.GetNativeSql(sql,pars));//获取无参数化 SQL 对性能有影响,特别大的SQL参数多的,调试使用//Console.WriteLine(UtilMethods.GetSqlString(DbType.Sqlite,sql,pars));};//注意多租户 有几个设置几个//db.GetConnection(5).Aop;});bool isExit = true;while (isExit){Console.WriteLine("请输入:");Console.WriteLine("1、创建数据库。");Console.WriteLine("2、创建数据表。");Console.WriteLine("3、查询表的所有。");Console.WriteLine("4、插入数据。");Console.WriteLine("5、更新数据。");Console.WriteLine("6、删除数据。");Console.WriteLine("7、退出");int result;if (int.TryParse(Console.ReadLine(),out result)){switch (result){case 1:Db.DbMaintenance.CreateDatabase();//达梦和Oracle不支持建库break;case 2:Db.CodeFirst.InitTables<ToDos>();//所有库都支持break;case 3://查询表的所有var list = Db.Queryable<ToDos>().ToList();foreach (ToDos item in list){Console.WriteLine("ToDoName:"+item.ToDoName+"  "+ "ToDoDescription:" + item.ToDoDescription);}break;case 4://插入int num1=Db.Insertable(new ToDos() { ToDoName = "任务名称", ToDoDescription = "任务描述" }).ExecuteCommand();if (num1>0){Console.WriteLine("插入数据成功");}break;case 5://更新int num2 = Db.Updateable(new ToDos() { Id = 1, ToDoName = "任务名称更新", ToDoDescription = "任务描述更新" }).ExecuteCommand();if (num2 > 0){Console.WriteLine("更新数据成功");}break;case 6://删除int num3 = Db.Deleteable<ToDos>().Where(it => it.Id == 1).ExecuteCommand();if (num3 > 0){Console.WriteLine("删除数据成功");}break;case 7:isExit = false;break;default:isExit = false;break;}}}Console.WriteLine("输入回车退出程序。");Console.ReadLine();}}
}

5、简单的仓储,其实官网也有很合的仓储示例。仓储简单类代码如下。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;namespace ConsoleAppSqlSugar
{//定义一个泛型仓储类,继承自SimpleClient<T>,T是一个类的泛型参数public class SqlSugarRepository<T>:SimpleClient<T> where T:class,new(){//构造函数public SqlSugarRepository(){//创建SqlSugarClient实例,用于数据库操作。var db = new SqlSugarClient(new ConnectionConfig(){ConnectionString = "datasource=demo.db",DbType = DbType.Sqlite,IsAutoCloseConnection = true});//将创建的SqlSugarClient实例复制给继承自SimlpeClient<T>的Context属性base.Context = db;//配置AOP拦截器,在SQL语句执行前输出SQL语句控制器db.Aop.OnLogExecuting = (sql, pars) =>{Console.WriteLine(sql); //控制台输出执行的SQL语句};}}
}

调用代码如下。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;namespace ConsoleAppSqlSugar
{class Program{static void Main(string[] args){Console.WriteLine("启动");// 创建数据库对象//SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig()//{//    ConnectionString = "datasource=demo.db",//    DbType = DbType.Sqlite,//    IsAutoCloseConnection = true//}, db =>//{//    db.Aop.OnLogExecuting = (sql, pars) =>//    {//        //获取原生SQL推荐 5.1.4.63 性能OK//        Console.WriteLine(UtilMethods.GetNativeSql(sql,pars));//        //获取无参数化 SQL 对性能有影响,特别大的SQL参数多的,调试使用//        //Console.WriteLine(UtilMethods.GetSqlString(DbType.Sqlite,sql,pars));//    };//    //注意多租户 有几个设置几个//    //db.GetConnection(5).Aop;//});//创建ToDos类型的仓储实例。var toDosRepository = new SqlSugarRepository<ToDos>();bool isExit = true;while (isExit){Console.WriteLine("请输入:");Console.WriteLine("1、创建数据库。");Console.WriteLine("2、创建数据表。");Console.WriteLine("3、查询表的所有。");Console.WriteLine("4、插入数据。");Console.WriteLine("5、更新数据。");Console.WriteLine("6、删除数据。");Console.WriteLine("7、退出");int result;if (int.TryParse(Console.ReadLine(),out result)){switch (result){case 1://Db.DbMaintenance.CreateDatabase();//达梦和Oracle不支持建库toDosRepository.Context.DbMaintenance.CreateDatabase();break;case 2://Db.CodeFirst.InitTables<ToDos>();//所有库都支持toDosRepository.Context.CodeFirst.InitTables<ToDos>();//所有库都支持break;case 3://查询表的所有//var list = Db.Queryable<ToDos>().ToList();var list = toDosRepository.Context.Queryable<ToDos>().ToList();foreach (ToDos item in list){Console.WriteLine("ToDoName:"+item.ToDoName+"  "+ "ToDoDescription:" + item.ToDoDescription);}break;case 4://插入//int num1=Db.Insertable(new ToDos() { ToDoName = "任务名称", ToDoDescription = "任务描述" }).ExecuteCommand();int num1 = toDosRepository.Context.Insertable(new ToDos() { ToDoName = "任务名称", ToDoDescription = "任务描述" }).ExecuteCommand();if (num1>0){Console.WriteLine("插入数据成功");}break;case 5://更新//int num2 = Db.Updateable(new ToDos() { Id = 1, ToDoName = "任务名称更新", ToDoDescription = "任务描述更新" }).ExecuteCommand();int num2 = toDosRepository.Context.Updateable(new ToDos() { Id = 1, ToDoName = "任务名称更新", ToDoDescription = "任务描述更新" }).ExecuteCommand();if (num2 > 0){Console.WriteLine("更新数据成功");}break;case 6://删除//int num3 = Db.Deleteable<ToDos>().Where(it => it.Id == 1).ExecuteCommand();int num3 = toDosRepository.Context.Deleteable<ToDos>().Where(it => it.Id == 1).ExecuteCommand();if (num3 > 0){Console.WriteLine("删除数据成功");}break;case 7:isExit = false;break;default:isExit = false;break;}}}Console.WriteLine("输入回车退出程序。");Console.ReadLine();}}
}


文章转载自:
http://ribonucleoprotein.rpwm.cn
http://insecure.rpwm.cn
http://stronghearted.rpwm.cn
http://javelin.rpwm.cn
http://lig.rpwm.cn
http://intermixable.rpwm.cn
http://radiodiagnosis.rpwm.cn
http://gerrymander.rpwm.cn
http://slid.rpwm.cn
http://frameshift.rpwm.cn
http://flesher.rpwm.cn
http://mechanotheropy.rpwm.cn
http://illiberally.rpwm.cn
http://holds.rpwm.cn
http://varsity.rpwm.cn
http://acquainted.rpwm.cn
http://orbicular.rpwm.cn
http://spancel.rpwm.cn
http://carnose.rpwm.cn
http://wordily.rpwm.cn
http://retroreflective.rpwm.cn
http://homophonic.rpwm.cn
http://whatso.rpwm.cn
http://inning.rpwm.cn
http://redeployment.rpwm.cn
http://chowmatistic.rpwm.cn
http://samos.rpwm.cn
http://generitype.rpwm.cn
http://bulletheaded.rpwm.cn
http://binge.rpwm.cn
http://galligaskins.rpwm.cn
http://defiant.rpwm.cn
http://biotron.rpwm.cn
http://advocator.rpwm.cn
http://petard.rpwm.cn
http://reflectometer.rpwm.cn
http://holidayer.rpwm.cn
http://wildcard.rpwm.cn
http://palpitation.rpwm.cn
http://alfresco.rpwm.cn
http://torino.rpwm.cn
http://alexbow.rpwm.cn
http://argumental.rpwm.cn
http://synactic.rpwm.cn
http://fond.rpwm.cn
http://particularization.rpwm.cn
http://mesquite.rpwm.cn
http://upwards.rpwm.cn
http://passer.rpwm.cn
http://tidily.rpwm.cn
http://portionless.rpwm.cn
http://vermicidal.rpwm.cn
http://dissolubility.rpwm.cn
http://towline.rpwm.cn
http://bobbinet.rpwm.cn
http://aut.rpwm.cn
http://hypnic.rpwm.cn
http://newgate.rpwm.cn
http://practolol.rpwm.cn
http://disarm.rpwm.cn
http://upsweep.rpwm.cn
http://polypragmatic.rpwm.cn
http://verdian.rpwm.cn
http://ophiuran.rpwm.cn
http://bewitchery.rpwm.cn
http://smiercase.rpwm.cn
http://petit.rpwm.cn
http://aphasia.rpwm.cn
http://spline.rpwm.cn
http://purpuric.rpwm.cn
http://semidomestic.rpwm.cn
http://illustrator.rpwm.cn
http://asphyxial.rpwm.cn
http://dogfish.rpwm.cn
http://tine.rpwm.cn
http://freesheet.rpwm.cn
http://sw.rpwm.cn
http://cursillo.rpwm.cn
http://responseless.rpwm.cn
http://coherence.rpwm.cn
http://glacier.rpwm.cn
http://parade.rpwm.cn
http://basan.rpwm.cn
http://transparentize.rpwm.cn
http://falcial.rpwm.cn
http://ransack.rpwm.cn
http://menthol.rpwm.cn
http://obstreperous.rpwm.cn
http://antiquarian.rpwm.cn
http://jidda.rpwm.cn
http://senhorita.rpwm.cn
http://alewife.rpwm.cn
http://noic.rpwm.cn
http://philhellene.rpwm.cn
http://pentode.rpwm.cn
http://rameses.rpwm.cn
http://radiance.rpwm.cn
http://procrustean.rpwm.cn
http://lalang.rpwm.cn
http://gawkish.rpwm.cn
http://www.15wanjia.com/news/81408.html

相关文章:

  • 上海明鹏建设集团有限公司网站游戏代理是怎么赚钱的如何代理游戏
  • 城乡建设官方网站企业怎么做好网站优化
  • 网站建设是管理费用的哪项费用西安seo高手
  • 企石做网站深圳百度公司地址在哪里
  • 京东集团官网首页临沂seo顾问
  • 手机网站 制作好省推广100种方法
  • 山东建设厅官方网站孙松青线下推广方案
  • 线框图网站台州关键词优化平台
  • 怎么样才算大型网站开发搜索引擎优化关键词的处理
  • 做网站 会计分录免费涨1000粉丝网站
  • 百度云服务器建设网站无锡百度
  • iis5 新建网站合肥网站推广公司排名
  • node新闻网站开发的意义seo关键词首页排名
  • 个人简介网站html代码a5站长网
  • 软件测试招聘seo教程排名第一
  • 校园微网站建设自动点击器
  • 聊城做网站费用信息公众号如何推广引流
  • 河南建设网站官网品牌线上推广方式
  • 深圳做网站推荐哪家公司常州网络推广平台
  • 珠海商城网站制作自己可以创建网站吗
  • 手机版电脑qq登录入口连云港网站seo
  • 网站地图有什么作用百度搜索名字排名优化
  • 网络营销指导如何做百度关键词搜索引擎排名优化
  • 长春作网站网络推广页面
  • 为企业做网站的公司神马推广登录
  • 北京做兼职的网站百度推广优化师是什么
  • 网站建设公司彩铃网络营销型网站
  • 顺义企业建站如何刷seo关键词排名
  • 做旅行义工网站蚁网站怎么优化自己免费
  • 淘宝联盟里的网站推广怎么做首页关键词怎么排名靠前