使用EFCore执行上下文不存在的SQL语句
摘要:using System; using System.Collections.Generic; using System.Data; using System.Data.Common; using System.Data.SqlClient; using System.Reflection; usi
阅读全文
posted @
2020-07-18 14:26
程铭
阅读(525)
推荐(0) 编辑
AutoMapper 模型转换
摘要:首先添加NuGet包 然后添加一个服务类 public class AutoMap:Profile { public AutoMap() { CreateMap<A, B>(); CreateMap<B, A>() .ForMember(des => des.Age, opt => opt.MapF
阅读全文
posted @
2020-07-18 14:20
程铭
阅读(209)
推荐(0) 编辑
HttpClient Post请求
摘要:using (HttpClient httpClient = new HttpClient()) { HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, URL); request.Content = new St
阅读全文
posted @
2020-07-18 13:36
程铭
阅读(237)
推荐(0) 编辑
C#根据中文description获取enum枚举值
摘要:/// <summary> /// 获取属性 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="description"></param> /// <returns></returns> private T Ge
阅读全文
posted @
2020-07-02 14:56
程铭
阅读(1193)
推荐(0) 编辑