摘要: context.Employees.Where(p=>p.Address.City == "上海").SingleOrDefault(); 查找满足条件的记录集合中的第一条,不存在返回默认值null。 context.Employees.Count(); // 表中记录的总数量 context.Em 阅读全文
posted @ 2021-10-04 19:19 ValueLee 阅读(31) 评论(0) 推荐(0)
摘要: 指定表名 [Table(account)] public class Account { } 标记主键 [Key] public int ID{get;set;} 标记最大长度和最小长度 [MaxLength(20)] [MinLength(5)] pubic string Name{get;set 阅读全文
posted @ 2021-10-03 20:42 ValueLee 阅读(100) 评论(0) 推荐(0)
摘要: 必备的dll EntityFramework.dll System.ComponentModel.DataAnnotations.dll MySql.Data.EntityFramework.dll MySql.Data.dll 安装mysql-connector-net.msi后,电脑上便有了My 阅读全文
posted @ 2021-10-03 17:29 ValueLee 阅读(87) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2021-09-30 00:42 ValueLee 阅读(221) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2021-09-13 11:16 ValueLee 阅读(610) 评论(0) 推荐(0)
摘要: 1. 避免不必要的装箱 自定义结构体 ```csharp struct MyStruct { } ``` FCL,String自带的拼接字符串方法 ```csharp public static String Concat(params object[] args); ``` 示例 ```cshar 阅读全文
posted @ 2021-08-23 17:30 ValueLee 阅读(215) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2021-07-24 05:55 ValueLee 阅读(37) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2021-07-24 05:54 ValueLee 阅读(147) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2021-07-19 07:19 ValueLee 阅读(811) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2021-06-15 20:38 ValueLee 阅读(111) 评论(0) 推荐(0)