实体框架设计器中的空白字符串默认值 [英] Blank String Default Value in Entity Framework Designer

查看:114
本文介绍了实体框架设计器中的空白字符串默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在实体框架的EDMX设计器中分配一个空白字符串(即)作为默认值?我发现唯一的技术是使用文本编辑器手动编辑edmx文件

Is it possible to assign a blank string (i.e. "") as a Default Value in the Entity Framework's EDMX designer? The only technique I've found is to edit the edmx file manually using a text editor

推荐答案

我意识到这是一个非常旧的问题,但为了后代的缘故,在EF4设计器中,您可以在属性窗口字段中键入一个空格,然后返回空格,将该字段留空,而不是缺省值(无)。对于字符串,这似乎默认为String.Empty。

I realize that this is an extremely old question, but for posterity's sake, in the EF4 designer you can type a space in the properties window field, then hit backspace, leaving the field empty instead of the default value of (None). For strings, this seems to default to String.Empty.

这篇关于实体框架设计器中的空白字符串默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆