EntityFrameowk6.1 使用enum和低版本的不同
原有项目中使用EF5.0 实体类
public partial class Log : BaseEntity
{
public Nullable<int> LogLevelId { get; set; }
/// <summary>
/// Gets or sets the log level
/// </summary>
public LogLevel LogLevel
{
get
{
return (LogLevel)this.LogLevelId;
}
set
{
this.LogLevelId = (int)value;
}
}
}
/// <summary>
/// Represents a log level
/// </summary>
public enum LogLevel
{
Debug = ,
Information = ,
Warning = ,
Error = ,
Fatal =
}
今天更新到EF6.1中,项目报错(An error occurred while updating the entries. See the inner exception for details),之前也没有看EF具体的更新内容,用SQL Profiler查看生成的SQL语句原来多了一个LogLevel字段,改成
public partial class Log : BaseEntity
{
//public int LogLevelId { get; set; }
/// <summary>
/// Gets or sets the log level
/// </summary>
public LogLevel LogLevelId { get; set; } }
/// <summary>
/// Represents a log level
/// </summary>
public enum LogLevel
{
Debug = ,
Information = ,
Warning = ,
Error = ,
Fatal =
}
可以保存成功了。等明天仔细看下EF5.0以后的更新内容。
EntityFrameowk6.1 使用enum和低版本的不同的更多相关文章
- android中如何在低版本(5.0之前)上使用tint(着色)属性
1. 使用app前缀(app:backgroundTint,app:backgroundTintMode),如果使用android前缀,在低版本上是拿不到值的,因为这些属性是5.0以后才加入的. 2. ...
- xcode低版本调试高版本真机系统
低版本xcode调试本真机高版本系统 //打开此路径把最新的文件拷贝到这里就可以了 /Applications/Xcode.app/Contents/Developer/Platforms/iPhon ...
- 低版本GCC程序向高版本移植的兼容性问题
将低版本gcc编译过的程序移植到高版本GCC时, 可能会出现一些兼容性问题. 原因是, 为了适应新的标准,一些旧的语法规则被废弃了. 关于这方面的一些具体资料可从该处查询. 这里只是自己遇到的其中一个 ...
- android中导入低版本project可能会遇到的编译问题(转自: Victor@Beijing)
使用高版本的SDK后再导入以前用低版本的project时,会遇到一些兼容性的问题. (1)Unable to resolve target 'android-5' 因为本机中现在使用的是2.2的SDK ...
- Sql Server本地高版本备份数据备份至远程低版本数据库方法
想要将Sqlserver高版本备份的数据还原到低版本SqlServer2008R2上去,但是这在SqlServer中是没法直接还原数据库的,通过以下方法可以顺利还原. 通过高版本生成sql脚本在低版本 ...
- 让低版本的 Android 项目显示出 Material 风格的点击效果
每天都被不同的需求纠缠的生活是幸福而又不幸的,这不我们家亲爱的设计师们又让我们在低版本的 Android 平台上实现一下类似于 Material Design 的点击效果. 虽然大家都知道 Mater ...
- android 在使用ViewAnimationUtils.createCircularReveal()无法兼容低版本的情况下,另行实现圆形scale动画
ViewAnimationUtils.createCircularReveal()的简介: ViewAnimationUtils.createCircularReveal()是安卓5.0才引入的,快速 ...
- 高版本->低版本迁移,低版本客户端连接高版本数据库EXP导出报错EXP-00008,ORA-01455,EXP-00000
生产环境: 源数据库:RHEL + Oracle 11.2.0.3 目标数据库:HP-UX + Oracle 10.2.0.4 需求:迁移部分表 11.2.0.3-->10.2.0.4,若 ...
- Android5.0 TimePicker,DatePicker恢复成低版本滚动模式
新版中的TimePicker DatePicker是不支持使用遥控器的, 恢复成低版本滚动模式只需要是xml文件加上一句即可: android:datePickerMode="spinner ...
随机推荐
- jsp页面传参到action出现乱码
jsp页面以连接方式传参到后台action时( <a href="http://localhost:8080/SocialBook/pages/bookdetail?book.id=& ...
- BlockingQueue队列学习
今天看了下BlockingQueue的几种实现,记录下以便以后复习. 首先来看一下BlockingQueue的家族成员: BlockingQueue除了先进先出外,还有两个操作:在队列为空时,获取元素 ...
- Linux硬链接与软连接
1.Linux链接概念 Linux链接分两种,一种被称为硬链接(Hard Link),另一种被称为符号链接(Symbolic Link).默认情况下,ln命令产生硬链接. [硬连接]硬连接指通过索引节 ...
- leetcode面试准备:Decode Ways
1 题目 A message containing letters from A-Z is being encoded to numbers using the following mapping: ...
- Service Trace Viewer Tool (SvcTraceViewer.exe)
Service Trace Viewer Tool <?xml version="1.0" encoding="utf-8" ?> <conf ...
- bzoj2002
这道题学习了一种简洁的解决一些数据结构题的方法——分块法这道题方法很多,但分块写起来只有1kb左右,非常的简洁(但不是非常的高效)首先很容易思考到一种暴力的做法,从后往前推,很容易搞出每个点会弹几次弹 ...
- 【转】unity3d input输入
Input 输入 按键 Input.GetKey(“up”) = Input.GetKey(KeyCode.UpArrow) 按住键盘上键 Input.GetKeyDown (“up”) 按下键盘上键 ...
- SRM 409(1-250pt, 1-500pt)
DIV1 250pt 题意:称string s是vector<string> words的ordered superstring,如果它满足:存在一个数列{x0, x1, x2...xm} ...
- linux —— 学习笔记(用户管理与权限控制)
目录:1.用户的创建和管理 2.组的创建和管理 3.文件执行权限的控制 4.不用密码执行sudo 1.用户的创建和管理 用户的创建和管理: useradd.usermod . userdel . ...
- 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(29)-T4模版
原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(29)-T4模版 这讲适合所有的MVC程序 很荣幸,我们的系统有了体验的地址了.演示地址 之前我们发布了一 ...