Entity Framework Code First
- 2 minutes to read
Note
You are viewing documentation for the legacy WPF Scheduler control. If you’re starting a new project, we strongly recommend that you use a new control declared in the DevExpress.Xpf.Scheduling namespace. If you decide to upgrade an existing project in order to switch to the updated scheduler control, see the Migration Guidelines document.
This document demonstrates a simple data model that can be used in an application with a database created using Code First development.
Create a class for an appointment named EFAppointment and a class for a resource named EFResource. You can use the following code.
Public Class EFAppointment
<Key()> _
Public Property UniqueID() As Integer
<Required> _
Public Property Type() As Integer
<Required> _
Public Property StartDate() As Date
<Required> _
Public Property EndDate() As Date
Public Property AllDay() As Boolean
Public Property Subject() As String
Public Property Location() As String
Public Property Description() As String
Public Property Status() As Integer
Public Property Label() As Integer
Public Property ResourceIDs() As String
Public Property ReminderInfo() As String
Public Property RecurrenceInfo() As String
End Class
Public Class EFResource
<Key()> _
Public Property UniqueID() As Integer
Public Property ResourceID() As Integer
Public Property ResourceName() As String
Public Property Color() As Integer
End Class
To learn more, refer to the Lesson 5 - Bind a Scheduler to Entity Framework Data Source (legacy) article.
See Also