摘要:
Startup文件加载: /// <summary> /// 配置信息对象 /// </summary> private readonly IConfiguration _configuration; /// <summary> /// 服务配置对象 /// </summary> private r 阅读全文
摘要:
直接调用: Task.Run(() => { try { var one = _dataContext.Student.FirstOrDefault(n =>n.Id == 5); // write to other } catch (Exception ex) { Console.WriteLin 阅读全文
摘要:
public static string ToSql<TEntity>(this IQueryable<TEntity> query) { var enumerator = query.Provider.Execute<IEnumerable<TEntity>>(query.Expression). 阅读全文
摘要:
public string checkKey(string text) { System.Text.StringBuilder sb = new System.Text.StringBuilder(text.Length); Dictionary<object, List<string>> dicL 阅读全文
摘要:
服务端: if (context.Request.Cookies["CheckCode5"] == null) { context.Response.Write("success_jsonpCallback(-1)"); context.Response.End(); } result = Chec 阅读全文
摘要:
服务端代码: string action = Request.QueryString["action"]; Response.ContentType = "text/json"; var origin = Request.Headers["Origin"]; if (!string.IsNullOr 阅读全文
摘要:
select ceiling(2.2222* 100)/100 --保留两位小数,小数位向上取整,输出:2.2300 select floor(2.2222* 100)/100 --保留两位小数,小数位向下取整, 输出:2.2200 阅读全文
摘要:
1 public class DecimalHelper 2 { 3 /// <summary> 4 /// Decimal类型截取保留N位小数并且不进行四舍五入操作 5 /// </summary> 6 /// <param name="d"></param> 7 /// <param name= 阅读全文
摘要:
Newtonsoft.Json.JsonSerializerSettings setting = new Newtonsoft.Json.JsonSerializerSettings(); JsonConvert.DefaultSettings = new Func(() => { //日期类型默认格式化处理 setting.DateFormatHandling = Newton... 阅读全文
摘要:
一般是引用了Microsoft.CodeDom.Providers.DotNetCompilerPlatform和Microsoft.Net.Compilers程序集会再bin目录下自动生成roslyn文件夹; 在程序nuget程序包管理中卸载程序集,删除bin目录下文件夹,重新生成即可解决; 阅读全文