一 背景 今天在使用EntityFrameworkCore 查询的时候在调试的时候总是提示如下错误:Unable to cast object of type 'System.Data.SqlTypes.SqlString' to type 'System.Data.SqlTypes.SqlGuid' 第一次看这个报错肯定是数据库实体和EFCore中定义的某种类型不匹配从而导致类型转换错误,但是业务涉及到这么多的实体Entity,那么到底是哪里类型无法匹配呢?所以第一步肯定是调试代码,然后看报
异常处理汇总-后端系列 http://www.cnblogs.com/dunitian/p/4523006.html 应用场景:ViewModel==>Mode映射的时候出错 AutoMappe r错误信息:Unmapped members were found. Review the types and members below.Add a custom mapping expression, ignore, add a custom resolver, or modify the sour
指定值只会执行一次 public class MomanBaseProfile : Profile { public MomanBaseProfile() { CreateMap<RequestBase, MomanEntity>() .ForMember(d => d.ID, op => op.Ignore()) .ForMember(d => d.UID, op => op.UseValue(Guid.NewGuid()))//使用Mapper过程中始终不变 .Fo