重庆熊猫 Loading

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 30 下一页
摘要: 更新记录 转载请注明出处: 2022年10月28日 发布。 2022年10月22日 从笔记迁移到博客。 存储大量数值优先考虑Array,而不是List 原因是,list以对象格式存储数据,当我们首先尝试存储值类型时,它将其转换为引用类型,然后再存储 List<int> list = new List 阅读全文
posted @ 2022-10-28 09:19 重庆熊猫 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 更新记录 转载请注明出处: 2022年10月27日 发布。 2022年10月22日 从笔记迁移到博客。 EF 实体变化跟踪 跟踪一个实体的时候,EFCore 会创建这个实体的快照。执行SaveChanges()等方法时,EF Core将会把存储的快照中的值与实体的当前值进行比较。 实体的状态 已添加 阅读全文
posted @ 2022-10-27 12:15 重庆熊猫 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 更新记录 转载请注明出处: 2022年10月26日 发布。 2022年10月22日 从笔记迁移到博客。 待完善 C#综合揭秘——Entity Framework 并发处理详解 - 风尘浪子 - 博客园 (cnblogs.com) Entity Framework 并发冲突解决方案_喵叔-CSDN博客 阅读全文
posted @ 2022-10-26 14:36 重庆熊猫 阅读(279) 评论(1) 推荐(0) 编辑
摘要: const randomString = () => Math.random().toString(36).slice(2); let result = randomString(); console.log(result); 阅读全文
posted @ 2022-10-26 14:35 重庆熊猫 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 更新记录 转载请注明出处: 2022年10月25日 发布。 2022年10月22日 从笔记迁移到博客。 生成测试数据(seed data) 说明 有几种方法可以创建模拟数据: 使用Fluent API OnModelCreating方法中触发创建数据 使用Fluent API OnModelCrea 阅读全文
posted @ 2022-10-25 09:37 重庆熊猫 阅读(37) 评论(0) 推荐(0) 编辑
摘要: //注意:末尾的...未计数哟 const truncateString = (string, length) => string.length < length ? string : `${string.slice(0, length)}...`; let result = truncateStr 阅读全文
posted @ 2022-10-25 09:37 重庆熊猫 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 注意:仅在浏览器环境下工作 const stripHtml = html => (new DOMParser().parseFromString(html, 'text/html')).body.textContent || ''; let result = stripHtml('<h1>Hi,Pa 阅读全文
posted @ 2022-10-25 09:36 重庆熊猫 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 更新记录 转载请注明出处: 2022年10月24日 发布。 2022年10月22日 从笔记迁移到博客。 初始化数据说明 初始化数据也叫种子数据,用于定义初始化到数据库中的数据 定义初始化数据 在DbContext类型中的ModelCreating方法中进行设置初始化数据 使用HasData方法即可 阅读全文
posted @ 2022-10-24 09:01 重庆熊猫 阅读(112) 评论(0) 推荐(0) 编辑
摘要: const random = (min, max) => Math.floor(Math.random() * (max - min + 1) + min); let result = random(1, 50); console.log(result); 阅读全文
posted @ 2022-10-24 09:00 重庆熊猫 阅读(18) 评论(0) 推荐(0) 编辑
摘要: const round = (n, d) => Number(`${Math.round(`${n}e${d}`)}e-${d}`); let result1 = round(1.666, 2) let result2 = round(1.888, 2) console.log(result1); 阅读全文
posted @ 2022-10-24 09:00 重庆熊猫 阅读(17) 评论(0) 推荐(0) 编辑
摘要: const reverse = str => str.split('').reverse().join(''); let result = reverse('Panda666'); console.log(result); 阅读全文
posted @ 2022-10-23 09:18 重庆熊猫 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 更新记录 转载请注明出处: 2022年10月23日 发布。 2022年10月22日 从笔记迁移到博客。 EF 迁移介绍 EF 迁移说明 EF Core API builds the EF Core model from the domain (entity) classes and EF Core 阅读全文
posted @ 2022-10-23 09:18 重庆熊猫 阅读(2745) 评论(0) 推荐(1) 编辑
摘要: 更新记录 转载请注明出处: 2022年10月17日 发布。 2022年10月10日 从笔记迁移到博客。 懒加载与预加载 默认情况下,EF是懒加载的,能只取一行数据就只取一行 如果需要预先加载全部数据,可以使用.Include方法 var queryResult = from item in db.S 阅读全文
posted @ 2022-10-22 08:02 重庆熊猫 阅读(163) 评论(0) 推荐(0) 编辑
摘要: const timeFromDate = date => date.toTimeString().slice(0, 8); let result1 = timeFromDate(new Date(2022, 8, 8, 12, 30, 0)); // 12:30:00 let result2 = t 阅读全文
posted @ 2022-10-22 08:01 重庆熊猫 阅读(51) 评论(0) 推荐(0) 编辑
摘要: const dayOfYear = (date) => Math.floor((date - new Date(date.getFullYear(), 0, 0)) / 1000 / 60 / 60 / 24); let result = dayOfYear(new Date()); console 阅读全文
posted @ 2022-10-22 08:01 重庆熊猫 阅读(3) 评论(0) 推荐(0) 编辑
摘要: const isDateValid = (...val) => !Number.isNaN(new Date(...val).valueOf()); let result = isDateValid("2022-10-10 16:16:00"); // true console.log(result 阅读全文
posted @ 2022-10-22 08:01 重庆熊猫 阅读(37) 评论(0) 推荐(0) 编辑
摘要: const dayDif = (date1, date2) => Math.ceil(Math.abs(date1.getTime() - date2.getTime()) / 86400000); let result = dayDif(new Date("2022-8-10 00:00:00") 阅读全文
posted @ 2022-10-21 10:36 重庆熊猫 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 更新记录 转载请注明出处: 2022年10月21日 发布。 2022年10月10日 从笔记迁移到博客。 EF中的事务说明 EF支持开箱即用的事务,无需复杂的配置 默认事务(Default Transaction) 只需要执行SaveChanges()一次,将会自动执行事务 只在事务执行成功的情况下保 阅读全文
posted @ 2022-10-21 10:35 重庆熊猫 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 更新记录 转载请注明出处: 2022年10月20日 发布。 2022年10月10日 从笔记迁移到博客。 存储过程(Stored Procedures) 在EFCore中定义存储过程 直接调用sql命令定义存储过程和移除存储过程 using(PandaDbContext db = new PandaD 阅读全文
posted @ 2022-10-20 08:58 重庆熊猫 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 更新记录 转载请注明出处: 2022年10月19日 发布。 2022年10月10日 从笔记迁移到博客。 增删改查 增删改说明 对实体进行增删改操作,会改变实体的EntityState属性 插入(Insert)操作 常用API | DbContext Methods | DbSet Methods | 阅读全文
posted @ 2022-10-19 08:51 重庆熊猫 阅读(722) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 30 下一页