In this lesson, you will learn how to use business classes from the Business Class Library as is. For this purpose, you will add the Event business class to the application.

在本课中,您将学习如何使用来自 Business 类库中的业务类。为此,您将事件业务类添加到应用程序。

Note

Before proceeding, take a moment to review the Inherit from the Business Class Library Class (EF) lesson.

注意
在继续之前,请花点时间复习从商务舱库类 (EF) 课程继承。

  • Register the Event and Resource classes in DbContext. Edit the BusinessObjects\MySolutionDbContext.cs file as shown below.

  • 在 DbContext 中注册事件和资源类。编辑业务对象_MySolutionDbContext.cs 文件,如下所示。

    public class MySolutionDbContext : DbContext {
    //...
    public DbSet<Event> Events { get; set; }
    public DbSet<Resource> Resources { get; set; }
    }
  • Rebuild the solution.
  • In the Solution Explorer, find the Module.cs (Module.vb) file within the MySolution.Module project. Double-click it to invoke the Module Designer

  • 重建解决方案。
  • 在解决方案资源管理器中,在 MySolution.模块项目中查找Module.cs(模块.vb)文件。双击以调用模块设计器。

  • In the Exported Types section, locate the Referenced Assemblies | DevExpress.Persistent.BaseImpl.EF.v19.2 | Event node. Select it and press the SPACEBAR, or right-click it and choose Use Type in Application in the invoked context menu. The node will be marked in bold. This means that the Event business class will be added to the Application Model, and this class will take part in the UI construction process. The use of extra modules is detailed in the Extra Modules section of this tutorial.

  • 在"导出的类型"部分中,找到引用的程序集 |开发快车.持久.BaseImpl.EF.v19.2 |事件节点。选择它并按空格键,或右键单击它,并在调用的上下文菜单中选择"在应用程序中使用类型"。节点将以粗体标记。这意味着事件业务类将添加到应用程序模型中,此类将参与 UI 构造过程。本教程的"额外模块"部分详细介绍了额外模块的使用。
  • If the Event class is not available in the Exported Types section, please ensure that your solution was rebuilt after registering this class in DbContext and restart the designer.

  • 如果事件类在"导出类型"部分中不可用,请确保在 DbContext 中注册此类并重新启动设计器后重新生成解决方案。
  • Run the WinForms or ASP.NET application and note that the Scheduler Event navigation item is created, as the Event class has the NavigationItemAttribute applied. Note that it may be necessary to add other classes from the Business Class Library to the navigation manually (see the Add an Item to the Navigation Control topic).

  • 运行 WinForms 或ASP.NET应用程序,并注意创建计划程序事件导航项,因为事件类已应用了导航项属性。请注意,可能需要手动将业务类库中的其他类添加到导航中(请参阅向导航控制主题添加项目)。
Tip

XAF has a special Scheduler module contains List Editor that uses the Scheduler Control (Win/Web) to display and manage Event business objects in XAF applications. Refer to the Add the Scheduler Module lesson to learn how to use it in your application.

You can see the code demonstrated in this lesson in the EF Demo (Code First) installed with XAF. By default, the EF Demo (Code First) application is installed in %PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\EFDemoCodeFirst.

提示
XAF 具有一个特殊的计划程序模块,其中包含列表编辑器,该编辑器使用计划程序控件 (Win/Web) 在 XAF 应用程序中显示和管理事件业务对象。请参阅添加计划程序模块课程,了解如何在应用程序中使用它。
您可以在随 XAF 安装的 EF 演示(代码优先)中看到本课中演示的代码。默认情况下,EF 演示(代码优先)应用程序安装在 %PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\EFDemoCodeFirst 中。

Add a Class from the Business Class Library从业务类库添加类(EF)的更多相关文章

  1. Add a Class from the Business Class Library 从业务类库添加类 (XPO)

    In this lesson, you will learn how to use business classes from the Business Class Library as is. Fo ...

  2. Inherit from the Business Class Library Class 继承自Business类(EF)

    In this lesson, you will learn how to implement business classes for your application using the Busi ...

  3. How to: Recompile the Business Class Library 如何:重新编译业务类库

    The eXpressApp Framework supplies the Business Class Library that consists of three assemblies. eXpr ...

  4. 使用 Portable Class Library(可移植类库)开发 Universal Windows App

    今天在这里跟大家聊聊关于 Windows Universal 应用夸平台的问题,首先Universal Windows App的定义相信大家已经有所了解了(如果你是一个刚刚接触 Universal A ...

  5. WPF - 为什么不能往Library的工程中添加WPF window

    项目中添加一个Library 工程,但是却无法加入WPF window, WPF customize control. 调查了一下,发现这一切都由于Library工程中没有:ProjectTypeGu ...

  6. Android 添加library的时候出错添加不上

    在向android工程中导入library的时候,会和出现导入不成功,打开查看添加library界面,会发现你添加的library的路径出现D:/work/...?类似的情况,但是别的工程使用的时候又 ...

  7. SPL(Standard PHP Library 标准PHP类库)

    SplFileObject 读取大文件从第N行开始读: $line = 10; $splFileObj = new SplFileObject(__FILE__,'r'); $splFileObj-& ...

  8. Add the Scheduler Module 添加计划程序模块

    Important 重要 Scheduler requires the Event business class to be in your XAF application model. Follow ...

  9. Add an Item to the Navigation Control 将项目添加到导航控件

    In this lesson, you will learn how to add an item to the navigation control. For this purpose, the N ...

随机推荐

  1. fastText训练word2vec并用于训练任务

    最近测试OpenNRE,没有GPU服务器,bert的跑不动,于是考虑用word2vec,捡起fasttext 下载安装 先clone代码 git clone https://github.com/fa ...

  2. linux环境下zookeeper下载安装

    步骤一:安装配置jdk环境 1.下载解压jdk-8u221-linux-x64.tar.gz 2.打开 配置文件,vim /etc/profile,添加如下配置,添加完成记得source /etc/p ...

  3. 原生JS实现移动端轮播图

    功能描述: 自动无缝轮播图片,底部小圆点跟图片保持一致:手指左右移动轮播图,移动距离大于50px播放下一张(或上一张),小于50px则回弹 具体功能实现: 1.定时器 自动轮播图片 先声明一个inde ...

  4. Mac 安装nginx之后重启、停止、开启等操作

    操作系统:macOs High Sierra 10.13.6 1.我用的homebrew安装的nignx1.15.9,安装完成之后会有下面的提示: 网站根目录在:/usr/local/var/www ...

  5. PMBOK 指南 第四章 项目整合管理(4.1-4.3)

    项目整合管理 包括对隶属于项目管理过程组的各个过程和项目管理活动进行识别.定义.组合.统一和协调的各个过程. 资源分配.平衡竞争性需求.研究各种备选方法.为实现项目目标而裁剪过程.管理各个项目管理知识 ...

  6. Scrum Meeting - 第七周【Alpha阶段】

    每日任务内容: 本次会议为第七次Scrum Meeting会议 本次会议项目经理召开时间为20:00,在北区男生宿舍楼召开,召开时长约10分钟,探讨了本周选课网站编写的后续工作. 小组成员 本周任务 ...

  7. mysql事务隔离级别、脏读、幻读

    Mysql事务隔离级别本身很重要,再加上可能是因为各大公司面试必问的缘故,在博客中出现的概率非常高,但不幸的是,中国的技术博客要么是转载,要么是照抄,质量参差不齐,好多结论都是错的,对于心怀好奇之心想 ...

  8. Beeline里面执行hive脚本 函数nvl2()与replace()报错

    Beeline里面执行hive脚本函数nvl2()与replace()报错 写脚本的时候是在impala里面执行的,都正常,但是转换为调度的时候是在beeline里面执行的 就会有问题了. 详情如下: ...

  9. 东芝开发板驱动OLED模块显示LOGO图片

    前言 在之前的两篇评测文章: 使用系统定时器SysTick实现精确延时微秒和毫秒函数 东芝MCU实现位带操作 介绍了系统SysTick实现精确延时,GPIO的输入输出使用,并实现了位带方式操作GPIO ...

  10. redis的介绍与操作及Django中使用redis缓存

    redis VS mysql的区别 """ redis: 内存数据库(读写快).非关系型(操作数据方便) mysql: 硬盘数据库(数据持久化).关系型(操作数据间关系) ...