Enums added to certain fields in model

This commit is contained in:
2018-11-14 22:56:16 +01:00
parent 768e4816b9
commit 7b3bc55346
3 changed files with 11 additions and 2 deletions

View File

@ -25,7 +25,7 @@ namespace DbFirst
public int AuthorID { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public CourseLevel Level { get; set; }
public DbFirst.Level Level { get; set; }
public short FullPrice { get; set; }
public virtual Author Author { get; set; }

View File

@ -199,7 +199,7 @@
<Property Name="AuthorID" Type="Int32" Nullable="false" />
<Property Name="Title" Type="String" MaxLength="255" FixedLength="false" Unicode="false" Nullable="false" />
<Property Name="Description" Type="String" MaxLength="8000" FixedLength="false" Unicode="false" Nullable="false" />
<Property Name="Level" Type="PlutoModel.CourseLevel" Nullable="false" />
<Property Name="Level" Type="PlutoModel.Level" Nullable="false" />
<NavigationProperty Name="Author" Relationship="Self.FK_Courses_Authors" FromRole="Courses" ToRole="Authors" />
<NavigationProperty Name="CourseSections" Relationship="Self.FK_CourseSections_Courses" FromRole="Courses" ToRole="CourseSections" />
<NavigationProperty Name="Tags" Relationship="Self.CourseTags" FromRole="Courses" ToRole="Tags" />
@ -335,6 +335,7 @@
<Member Name="Intermediate" Value="2" />
<Member Name="Advanced" Value="3" />
</EnumType>
<EnumType Name="Level" UnderlyingType="Byte" a:ExternalTypeName="DbFirst.Level" xmlns:a="http://schemas.microsoft.com/ado/2006/04/codegeneration" />
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->

View File

@ -8,6 +8,14 @@ using static System.Console;
namespace DbFirst
{
public enum Level : byte
{
Beginner = 1,
Intermediate = 2,
Advanced = 3
}
class Program
{
static void Main(string[] args)