- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 EF 5.0(计划很快发布)之前, Entity Framework 将不支持枚举。
Entity Framework 4.2 enum support
http://blogs.msdn.com/b/efdesign/archive/2011/06/29/enumeration-support-in-entity-framework.aspx
WCF 数据服务(和 oData 标准)不支持枚举
We understand that enums are common, unfortunately they never met tha bar so far. They are rather high on our list of things to do next though
(参见:https://stackoverflow.com/a/3571378/141172)
我开始了一个新项目,正在用类似的东西替换枚举:
public static class MyEnum
{
public const int MyValue = 0;
public const int AnotherValue = 1;
}
我牺牲了枚举提供的保证,即只有定义的值才会被分配,以便利用重要的(并且在这一点上相当成熟的)基础设施服务。
是否有更好的方法来处理滞后的枚举支持?一旦 EF 和 WCF 数据服务添加了枚举支持,是否可能会出现另一个重要的框架,它会像这两个框架一样缓慢地引入枚举支持?
最佳答案
你能否使用一个带有私有(private)构造函数的结构,为每个值定义一个公共(public)静态成员:
public struct FakeEnum
{
public static readonly FakeEnum MyValue = new FakeEnum(0);
public static readonly FakeEnum AnotherValue = new FakeEnum(1);
private readonly int _value;
private FakeEnum(int value)
{
_value = value;
}
public int Value { get { return _value; } }
// TODO: Equals and GetHasCode and Operators Oh My!
}
注意:我还没有实际尝试过。
关于.net - 应对落后的枚举支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9185116/
let config = [{ name: 1, state: 1, output: 'Y', }, { name: 2, state: 1, outp
我在使用 C# 统一编程时遇到了一些问题。我试图在开始游戏时请求一个插页式广告,这样我就可以在玩家死亡 5 次时显示它。问题是,当我遇到第 5 次死亡时,广告将不会显示。当我尝试在关卡开始时请求广告时
我有 JPanel,从中打开一个扩展 AbstractAIFDialog 的搜索条件对话框。它由搜索条件文本字段、结果 TableView 和搜索按钮组成。单击“搜索”后,在此对话框中,我需要显示进度
所以,我的蛇做了连续的运动,但如果我按任意键,它就会及时倒退并前后滞后。这是视频:https://youtu.be/KCesu5bGiS8 我的猜测是更快地更新按键输入,但是当我这样做时,所有内容都会
我正在尝试获得 TODAY THE CURRENT 的所有选票,并且我几乎已经通过以下 mysql 查询实现了这一点,但是有一个问题。 这段代码让我获得了今天的选票: SELECT COUNT(*)
我正在使用 RS256 算法生成 Azure AD token 。 当我解码 https://jwt.io/ 中的 token 时发出的时间比请求时间晚了 5 分钟。 请求的时间:美国标准时间晚上 9
当我查询 NOW() 时,mysql 返回的时间与服务器上的当前时间相差大约 -30 秒。有任何想法吗?我尝试查看配置文件,但一无所获。我正在运行 5.1.37 版本 SELECT NOW() 最佳答
我正在做一个开源项目。我首先 fork 这个项目,将它克隆到我的机器上,然后直接在 master 分支上进行了更改。我提交了这些更改并将其推到我的 fork 上。然后我打开了该更改的 pull 请求。
所以我用了大约 20 分钟写出了这个程序,并花了最后 40 分钟绞尽脑汁地想为什么它返回 21131 而不是 21124,这似乎是正确的答案。我知道代码没有问题(很可能),因为它适用于我测试的每个数字
我在使用 QueryDsl 日期算法时遇到问题。它对我不起作用,会引发以下错误: Caused by: org.postgresql.util.PSQLException: ERROR: functi
嗨,我正在玩 Angular ui 时间选择器 http://angular-ui.github.io/bootstrap/ 当我使用它时,我的日期晚了 1 小时,我该如何更改它以及为什么? JS
我是一名优秀的程序员,十分优秀!