Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Entity framework 在业务对象内指定属性编辑器_Entity Framework_Devexpress_Xaf - Fatal编程技术网

Entity framework 在业务对象内指定属性编辑器

Entity framework 在业务对象内指定属性编辑器,entity-framework,devexpress,xaf,Entity Framework,Devexpress,Xaf,我将devexpressXAF与实体框架一起使用。 我希望能够指定我的Description字段使用属性编辑器DevExpress.ExpressApp.HtmlPropertyEditor.Win.HtmlPropertyEditor 我可以通过在涉及该字段的视图中设置model.xafml内的属性编辑器来实现这一点。但是,我更愿意在business对象中将其作为属性设置一次 有办法做到这一点吗?develxpress知识库在这里解释了如何实现这一点:。见第2.2节和第2.3节 如果业务对象与

我将
devexpress
XAF
实体框架一起使用。
我希望能够指定我的
Description
字段使用属性编辑器
DevExpress.ExpressApp.HtmlPropertyEditor.Win.HtmlPropertyEditor

我可以通过在涉及该字段的视图中设置
model.xafml
内的属性编辑器来实现这一点。但是,我更愿意在
business
对象中将其作为属性设置一次


有办法做到这一点吗?

develxpress知识库在这里解释了如何实现这一点:。见第2.2节和第2.3节

如果业务对象与编辑器在同一模块中声明,则可以执行以下操作:

//Class declared in a WinForms module, for example
public class BusinessObject : BaseObject {
    ...
    [ModelDefault("PropertyEditorType", "SampleSolution.Module.Win.PropertyEditors.CustomStringEditor")]
    public string Description {
        get { return GetPropertyValue<string>("Description"); }
        set { SetPropertyValue<string>("Description", value); }
    }
}
并在编辑器中设置相同的字符串标识符。(这允许在单独的Web和Win模块中指定不同的编辑器)


我在独立于平台的模块中声明了业务对象。我需要它,因为这是实体框架上下文所在的位置。所以使用
EditorAlias
,如2.3所述。
public class BusinessObject : BaseObject {
    ...
    [EditorAlias("CustomStringEdit")]
    public string Description {
        get { return GetPropertyValue<string>("Description"); }
        set { SetPropertyValue<string>("Description", value); }
    }
}
[PropertyEditor(typeof(String), "CustomStringEdit", false)]
public class CustomStringEditor : StringPropertyEditor {
    public CustomStringEditor(Type objectType, IModelMemberViewItem info)
        : base(objectType, info) {  }
    ...
}