Several changes before queryDatabase project

This commit is contained in:
2019-11-13 22:22:46 +01:00
parent 9d861108d3
commit 1fc695559a
23 changed files with 1120 additions and 24 deletions

View File

@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CodeFirstExistingDatabase
{
public class Category
{
public int Id { get; set; }
public string Name { get; set; }
}
}

View File

@ -56,7 +56,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Author.cs" />
<Compile Include="Category.cs" />
<Compile Include="Course.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
@ -80,6 +79,30 @@
<Compile Include="Migrations\201911122203311_AddCategoryColumnToCoursesTable.Designer.cs">
<DependentUpon>201911122203311_AddCategoryColumnToCoursesTable.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201911122214252_AddDatePublishedColumnToCoursesTable.cs" />
<Compile Include="Migrations\201911122214252_AddDatePublishedColumnToCoursesTable.Designer.cs">
<DependentUpon>201911122214252_AddDatePublishedColumnToCoursesTable.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201911122218222_RenameTitleColumnToNameInCoursesTable.cs" />
<Compile Include="Migrations\201911122218222_RenameTitleColumnToNameInCoursesTable.Designer.cs">
<DependentUpon>201911122218222_RenameTitleColumnToNameInCoursesTable.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201911122233106_DeleteDatePublishedColumnInCoursesTable.cs" />
<Compile Include="Migrations\201911122233106_DeleteDatePublishedColumnInCoursesTable.Designer.cs">
<DependentUpon>201911122233106_DeleteDatePublishedColumnInCoursesTable.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201911122236570_DeleteCategoryColumnFromCoursesTable.cs" />
<Compile Include="Migrations\201911122236570_DeleteCategoryColumnFromCoursesTable.Designer.cs">
<DependentUpon>201911122236570_DeleteCategoryColumnFromCoursesTable.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201911122240554_DeleteCategoriesTable.cs" />
<Compile Include="Migrations\201911122240554_DeleteCategoriesTable.Designer.cs">
<DependentUpon>201911122240554_DeleteCategoriesTable.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201911131933044_PopulateCategoriesTable.cs" />
<Compile Include="Migrations\201911131933044_PopulateCategoriesTable.Designer.cs">
<DependentUpon>201911131933044_PopulateCategoriesTable.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="PlutoContext.cs" />
<Compile Include="Program.cs" />
@ -97,6 +120,24 @@
<EmbeddedResource Include="Migrations\201911122203311_AddCategoryColumnToCoursesTable.resx">
<DependentUpon>201911122203311_AddCategoryColumnToCoursesTable.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201911122214252_AddDatePublishedColumnToCoursesTable.resx">
<DependentUpon>201911122214252_AddDatePublishedColumnToCoursesTable.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201911122218222_RenameTitleColumnToNameInCoursesTable.resx">
<DependentUpon>201911122218222_RenameTitleColumnToNameInCoursesTable.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201911122233106_DeleteDatePublishedColumnInCoursesTable.resx">
<DependentUpon>201911122233106_DeleteDatePublishedColumnInCoursesTable.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201911122236570_DeleteCategoryColumnFromCoursesTable.resx">
<DependentUpon>201911122236570_DeleteCategoryColumnFromCoursesTable.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201911122240554_DeleteCategoriesTable.resx">
<DependentUpon>201911122240554_DeleteCategoriesTable.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201911131933044_PopulateCategoriesTable.resx">
<DependentUpon>201911131933044_PopulateCategoriesTable.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>

View File

@ -17,12 +17,10 @@ namespace CodeFirstExistingDatabase
public int Id { get; set; }
public string Title { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public Category Category { get; set; }
public int Level { get; set; }
public float FullPrice { get; set; }

View File

@ -0,0 +1,29 @@
// <auto-generated />
namespace CodeFirstExistingDatabase.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class AddDatePublishedColumnToCoursesTable : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(AddDatePublishedColumnToCoursesTable));
string IMigrationMetadata.Id
{
get { return "201911122214252_AddDatePublishedColumnToCoursesTable"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

View File

@ -0,0 +1,18 @@
namespace CodeFirstExistingDatabase.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class AddDatePublishedColumnToCoursesTable : DbMigration
{
public override void Up()
{
AddColumn("dbo.Courses", "DatePublished", c => c.DateTime());
}
public override void Down()
{
DropColumn("dbo.Courses", "DatePublished");
}
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Target" xml:space="preserve">
<value>H4sIAAAAAAAEAO1b227cNhB9L9B/EPTUFs7Kdl5aYzeBu7YLo/EFXjvom0FL3DVRilJFythF0S/rQz+pv1BSV4oX3XZtJ2kQILFFzuHcOBwOJ//+/c/0/TrEzhNMKIrIzD2Y7LsOJH4UILKauSlbvvnRff/u22+mp0G4dj6W896KeZyS0Jn7yFh85HnUf4QhoJMQ+UlEoyWb+FHogSDyDvf3f/IODjzIIVyO5TjTm5QwFMLsF/7rPCI+jFkK8EUUQEyL73xkkaE6lyCENAY+nLlzPuMMJZSdrhFlnM0TwMADoNB1jjECnKEFxEvXAYREDDDO7tEdhQuWRGS1iPkHgG83MeTzlgALqkyMo3p6X4n2D4VEXk1YQvk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wItBvHAbVnHOyjMpjSeGonKJcjS8gAwE/KY4ThpbAZ3zYh5RmPesfAU75lNPwAQbn5Cplccq4yDB8wI39Ls62tvWzNq0mz9OrrIZKdyECZxOJkukV+TlFOKj4PjPc0C0Q4tAsKj7ClkxUflabCukyIj2BCvVVZ/0tDGPMwegVWYAnOIa3Owo/wBXwN+WzjB2k2xBNtU9PEFglIKQFRk3Pf+U+HITrd/8BlXon5oo9AAA=</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>

View File

@ -0,0 +1,29 @@
// <auto-generated />
namespace CodeFirstExistingDatabase.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class RenameTitleColumnToNameInCoursesTable : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(RenameTitleColumnToNameInCoursesTable));
string IMigrationMetadata.Id
{
get { return "201911122218222_RenameTitleColumnToNameInCoursesTable"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

View File

@ -0,0 +1,22 @@
namespace CodeFirstExistingDatabase.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class RenameTitleColumnToNameInCoursesTable : DbMigration
{
public override void Up()
{
AddColumn("dbo.Courses", "Name", c => c.String(nullable: false));
Sql("UPDATE Courses SET Name = Title");
DropColumn("dbo.Courses", "Title");
}
public override void Down()
{
AddColumn("dbo.Courses", "Title", c => c.String(nullable: false));
Sql("UPDATE Courses SET Title = Name ");
DropColumn("dbo.Courses", "Name");
}
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Target" xml:space="preserve">
<value>H4sIAAAAAAAEAO1bW2/bNhR+H7D/IOhpG1IrSV+2wG6ROckQrLkgToq9BYxEO8QoyhOpwMawX7aH/aT9hZG6UrzoZtf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utpKhlNNZjDWF+UyXU24U3+xFxB24Cy9enQ2b8rZ9elifZrc59nyOfTZ6E/Llnq/0rNt7aPJqkb8VvoUcfNmyY+lLcDSZNPQY2MCt3ULWBpw1o3tN8YF7M0nhvYcW3eOCdnY4mFWihlZGrPg27Szg+4gRd/1h7P2xhhDS8h2m3/KBpbGHiBLpXoIu7aDz1hO366oRZdNs6jmAriaJyivbvsVcuvtTYZ+pk/urD3al/RyPj8SpP9/ys8jihYVhHhvItCvHQblnEsyj4pjSeGomKJcja8gAwE/KU5jhubAZ3zYh5SmDesfAU74lPPwCQaX5CZhy4RxkWH4hGv7XZxtTeunPVp1nsc3aQ2VbkMEziYSJdMb8nOCcFDyfWG4oVsgxKGZV3yELZmo/CzWJdJ1RDoC5eorz/p7GC4xB6M3ZAZe4BDeHij8ABfAXxevMnaQdkPU1T4+Q2ARg5DmGBU9/5X7cBCu3v0H1NtxWoY9AAA=</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>

View File

@ -0,0 +1,29 @@
// <auto-generated />
namespace CodeFirstExistingDatabase.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class DeleteDatePublishedColumnInCoursesTable : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(DeleteDatePublishedColumnInCoursesTable));
string IMigrationMetadata.Id
{
get { return "201911122233106_DeleteDatePublishedColumnInCoursesTable"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

View File

@ -0,0 +1,18 @@
namespace CodeFirstExistingDatabase.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class DeleteDatePublishedColumnInCoursesTable : DbMigration
{
public override void Up()
{
DropColumn("dbo.Courses", "DatePublished");
}
public override void Down()
{
AddColumn("dbo.Courses", "DatePublished", c => c.DateTime());
}
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Target" xml:space="preserve">
<value>H4sIAAAAAAAEAO1bW2/bNhR+H7D/IOhpG1IrSV+2wG6ROckQrLkgToq9BYx07AijKE+kAhvDftke9pP2F0bdKV50s2t3bVCgTUSej+fGw8PD03///mf8fhVg6wUi6odkYh+NDm0LiBt6PllM7JjN3/xov3/37Tfjcy9YWR+LeW+TeZyS0In9zNjyxHGo+wwBoqPAd6OQhnM2csPAQV7oHB8e/uQcHTnAIWyOZVnju5gwP4D0F/7rNCQuLFmM8FXoAab5dz4yS1GtaxQAXSIXJvaUz7jwI8rOVz5lnM0zxNATomBbp9hHnKEZ4LltIUJChhhn9+SBwoxFIVnMlvwDwvfrJfB5c4QTqlSMk2p6V4kOjxOJnIqwgHJjysKgJ+DR21xFjkw+SNF2qUKuxHOubLZOpE4VObFPY/YcRrYlL3UyxVEyrUHLo4z2wDLOOCjdhHtT8ofPjTGLI5gQiFmE8IF1Gz9h3/0V1vfh70AmJMZY5JjzzMdqH/in2yhcQsTWdzDP5bj0bMup0zkyYUkm0GQyXhL29ti2rvni6AlD6RCCPmYsjOAXIBAhBt4tYgwikmBAqlJldWmt5O9iNe6BXEm2dYVWH4As2PPE5j/a1oW/Aq/4knPwQHy+BTkRi2JQFrlGL/4i5U9abhrGEQVqW3eA03H67C+z/ZCb7bGcchGFwV2IS2coRh5n/F834TrUDt+jaAGsztPYqTys0e8ykGF+l9G++t3+/E5a5AyoG/nLLER94rU+wAvgNv01Q1zw6beR71aK4axi6I2T7wfFnF03aRF7N9mjxSY07NFiC3eOG9zJFmG01jKVgT5WcyqupCEldMjjutjRxNc9WuiDWQ6cjSv8JJ9NvKRjm8WwUhGDolhO/RrH9hTHOtuZe8owE3PCV+v+z7KjDgFFjrm6YNPF0U4pDV0/ZaDGWBVh6/KcE89qCbeZBis5uBq5S/lL7kScgYn9g6IkM2gppgBaRrw67OFodCTLLEjXSehU4y281eP5Fo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r97PeT8Ka4v/uniEbCihbf3k0Vhw1Dt98Wdz6Y2Pj67v2ojPEZkfKBeuGnAEGBtapm2XRU0Rd5Kl7JbmANK+fvvUpLLQ/2A/2nO7W3Irf6GtK/WLlrh1HdxsVDCebTGOsL8pluppwp/5ivvPvwFl6tcBs3vOy69PF+PK3z7Plc2hjUV9uDSV6qSXa2KaSFXomtvcUcvNmyY/h1d3Qw9LQwqIDNz3GG/pb1o3dLdoFzL0dmu4XU/OLDlnbQaFXih5ZGDPgm7Szg+YbSd/1t672vhNNx8V2e2vK/pDGFhtDcXkIu6aDT1sB366oRRNLs6j6mrWcJ0gPZfsVcuvdQ5p2oU/urD26g9QKPD8ShP+hyc8j6i8qiOSJiIBbOwzKOZdkHhbHksRRMUW6Gl8BQx4/KU4j5s+Ry/iwC5Sm/eAfEY75lPPgCbxLchOzZcy4yBA84dp+T862pvXTFqg6z+ObtOxJtyECZ9PnIsAN+Tn2sVfyfaG5oRsgkkMzr/gktmRJ5WexLpGuQ9IRKFdfedbfQ7DEHIzekBl6gSG8PVD4AAvkrouHFDNIuyHqah+f+WgRoYDmGBU9/5X7sBes3v0HLIEhjqg8AAA=</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>

View File

@ -0,0 +1,29 @@
// <auto-generated />
namespace CodeFirstExistingDatabase.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class DeleteCategoryColumnFromCoursesTable : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(DeleteCategoryColumnFromCoursesTable));
string IMigrationMetadata.Id
{
get { return "201911122236570_DeleteCategoryColumnFromCoursesTable"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

View File

@ -0,0 +1,22 @@
namespace CodeFirstExistingDatabase.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class DeleteCategoryColumnFromCoursesTable : DbMigration
{
public override void Up()
{
DropForeignKey("dbo.Courses", "Category_Id", "dbo.Categories");
DropIndex("dbo.Courses", new[] { "Category_Id" });
DropColumn("dbo.Courses", "Category_Id");
}
public override void Down()
{
AddColumn("dbo.Courses", "Category_Id", c => c.Int());
CreateIndex("dbo.Courses", "Category_Id");
AddForeignKey("dbo.Courses", "Category_Id", "dbo.Categories", "Id");
}
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Target" xml:space="preserve">
<value>H4sIAAAAAAAEAO0by27jNvBeoP8g6NQWWSvJXtrA3kXqJEXQzQNxdtFbwEhjRyhFuSIV2Cj6ZT30k/oLHb0pPmTJcZPuNlggG5Oc4bxnOOP8/edf4/eriDqPkPAwZhP3YLTvOsD8OAjZYuKmYv7me/f9u6+/Gp8G0cr5VJ17m51DSMYn7oMQyyPP4/4DRISPotBPYh7PxciPI48EsXe4v/+Dd3DgAaJwEZfjjG9SJsII8g/4cRozH5YiJfQiDoDych13ZjlW55JEwJfEh4k7xRNnYcLF6SrkAsk8IYLcEw6uc0xDggTNgM5dhzAWCyKQ3KOPHGYiidlitsQFQm/XS8Bzc0IzqJyNo+Z4X472DzOOvAawQuWnXMTRQIQHb0sReSr4VoJ2axGiEE9R2GKdcZ0LcuIep+IhTlxHvepoSpPsWIeURwXsnmM9sVebCVpT9g/PplSkCUwYpCIhdM+5Tu9p6P8M69v4V2ATllIqU4w0415rAZeuk3gJiVjfwLzk4zxwHa8N56mANZgEU/B4zsTbQ9e5xMvJPYXaICR5zEScwE/AICECgmsiBCQswwG5SLXblbuyn9VtaIEoJNe5IKsPwBbiYeLir65zFq4gqFZKCj6yEF0QgUSSgnbJJXkMFzl9ynXTOE04cNe5AZrv84dwWfhDqba7+shZEkc3Ma2Nodq5m+H/fkZ1bNy+JckCRJumsddYWKfdFUi2s7sC9tXuXs7ulEtOgPtJuCxC1L981wd4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mfsMHHa/i6h/atjSvrkpFP22uITZLWLplmEPWgDaH7KWBiuxhdxdQAy7easJjrDS1xmiP8cSBVuFesROgIMA59osyZkq4TwJdXFkF2H1/3pXWSNg8FNp2SGLt0+x8KmJ9IAx2l91PQroNx/QckBSnqsygrC/KZPqq8Fntxf7oegZjGTRmffpctXek2ukg9fl0/tmMSvUJiaU1pnzTyzoKLV7aEze4j1G9Rf6zTLcsc9KOMakJuW3oZZih2kaoJrTGKaJluLruHK0aiZamsr2EYqZe2rPwYJPOpgFvPaTsnPNaWl8GR9fHI5snvBLPSn/u6dNd0wy5m1VzR01Nokor/WWZ3PkI2zCz7sFiD+3vZkSt9wcxXkp/lYHBmoeLBkX2NxoM/FakrM+cs3lcxWyFouqI8nS4AEECDKPHiQjnxBe47QPn+RfCPhGa4pHT6B6Cc3aVimUqkGWI7mnr2xdZ4O+6P5/Dt2keX+VNGb4LFpDMEFmAK/ZjGtKgpvvM8IKxoMgySvkiznQpspfxYl1juoxZT0Sl+OpEeAvRkiIyfsVm5BG2oe0jhw+wIP66avPakWxWRFvs45OQLBIS8RJHA48f0YaDaPXuHxecr/+cNAAA</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>

View File

@ -0,0 +1,29 @@
// <auto-generated />
namespace CodeFirstExistingDatabase.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class DeleteCategoriesTable : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(DeleteCategoriesTable));
string IMigrationMetadata.Id
{
get { return "201911122240554_DeleteCategoriesTable"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

View File

@ -0,0 +1,37 @@
namespace CodeFirstExistingDatabase.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class DeleteCategoriesTable : DbMigration
{
public override void Up()
{
CreateTable(
"dbo._Categories",
c => new
{
Id = c.Int(nullable: false, identity: true),
Name = c.String(),
})
.PrimaryKey(t => t.Id);
Sql("INSERT INTO _Categories (Name) SELECT Name From Categories");
DropTable("dbo.Categories");
}
public override void Down()
{
CreateTable(
"dbo.Categories",
c => new
{
Id = c.Int(nullable: false, identity: true),
Name = c.String(),
})
.PrimaryKey(t => t.Id);
Sql("INSERT INTO Categories (Name) SELECT Name From _Categories");
DropTable("dbo._Categories");
}
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Target" xml:space="preserve">
<value>H4sIAAAAAAAEAO1a227bRhB9L9B/IPjUFo4oOy+tISVwZbswGl9gOUHfjDU5kokulyx3acgI+mV96Cf1Fzq8arkXipQVu2kCA7ZF7pyd+87O6J+//p68XUXUeYCUhzGbuvujsesA8+MgZMupm4nFqx/dt2++/WZyEkQr50O97nW+DikZn7r3QiSHnsf9e4gIH0Whn8Y8XoiRH0ceCWLvYDz+ydvf9wAhXMRynMl1xkQYQfEBP85i5kMiMkLP4wAor57jm3mB6lyQCHhCfJi6M1xxGqZcnKxCLpDNYyLIHeHgOkc0JMjQHOjCdQhjsSAC2T18z2Eu0pgt5wk+IPTmMQFctyA0pyrEOFwv7yvR+CCXyFsT1lB+xkUcDQTcf12pyFPJt1K026gQlXiCyhaPudSFIqfuUSbu49R11K0OZzTNl3VoeVTS7jnWFXuNm6A35T+4NqMiS2HKIBMpoXvOVXZHQ/9XeLyJfwc2ZRmlMsfIM75rPcBHV2mcQCoer2FRyXEWuI7XpvNUwoZMoillPGPi9YHrXODm5I5C4xCSPuYiTuEXYJASAcEVEQJSlmNAoVJtd2Wv/He9G3ogKsl1zsnqHbCluJ+6+K/rnIYrCOonFQfvWYghiEQizUDb5II8hMuCP2W7WZylHLjrXAMt3vP7MCnjoTLbbbPkNI2j65g2zlC/uZ3jXz/nOja+viHpEkSbp4m39rBOvytBtvO7kvar372c3ymbHAP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PWTOrRjN3XSrZLdgwUBDhHfnkuzwj3SaCrKy9puvcvenAaC5tb4Nu2hK132533gK0V7+Bw2X3ft9txTPWtZDjVZAZj/a9cpq8Jn9Vf7LeIZ3CWQUOlp0+RemeqnY6Nns/mn81gSO8qW3o7yvcdrIOf8uo4dYO7GM1bnn+WiYBlKtQxFDKB2wYFhomRbWBkgjVOXswMm5GldxZ8G+ebBlbN0KVzbmXpsxiCUG/3bp5YSTIrzaCnT6tMM7FuUc3tG/WAU1qDLyvkzkdyhhlcDxF7WH83Ize9GYW5TPreMCZSHi7XEPm3iBn4rSzWrDlji7jOpwpH9RKlrD8HQQJMcUepCBfEF/jaB86Lb8l8IDTDJSfRHQRn7DITSSZQZIjuaOtbN3lS7tq/mCu2eZ5cFh0AvgsRkM0QRYBL9nMW0qDh+9Rwu7BA5Nm+uq3mthT5rXX52CBdxKwnUKW+5pC6gSihCMYv2Zw8wDa8vefwDpbEf6x7inaQzYZoq31yHJJlSiJeYazp8SP6cBCt3vwLbPwcSD4vAAA=</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>

View File

@ -0,0 +1,29 @@
// <auto-generated />
namespace CodeFirstExistingDatabase.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class PopulateCategoriesTable : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(PopulateCategoriesTable));
string IMigrationMetadata.Id
{
get { return "201911131933044_PopulateCategoriesTable"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

View File

@ -0,0 +1,17 @@
namespace CodeFirstExistingDatabase.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class PopulateCategoriesTable : DbMigration
{
public override void Up()
{
//Sql();
}
public override void Down()
{
}
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Target" xml:space="preserve">
<value>H4sIAAAAAAAEAO1a227bRhB9L9B/IPjUFo4oOy+tISVwZbswGl9gOUHfjDU5kokulyx3acgI+mV96Cf1Fzq8arkXipQVu2kCA7ZF7pyd+87O6J+//p68XUXUeYCUhzGbuvujsesA8+MgZMupm4nFqx/dt2++/WZyEkQr50O97nW+DikZn7r3QiSHnsf9e4gIH0Whn8Y8XoiRH0ceCWLvYDz+ydvf9wAhXMRynMl1xkQYQfEBP85i5kMiMkLP4wAor57jm3mB6lyQCHhCfJi6M1xxGqZcnKxCLpDNYyLIHeHgOkc0JMjQHOjCdQhjsSAC2T18z2Eu0pgt5wk+IPTmMQFctyA0pyrEOFwv7yvR+CCXyFsT1lB+xkUcDQTcf12pyFPJt1K026gQlXiCyhaPudSFIqfuUSbu49R11K0OZzTNl3VoeVTS7jnWFXuNm6A35T+4NqMiS2HKIBMpoXvOVXZHQ/9XeLyJfwc2ZRmlMsfIM75rPcBHV2mcQCoer2FRyXEWuI7XpvNUwoZMoillPGPi9YHrXODm5I5C4xCSPuYiTuEXYJASAcEVEQJSlmNAoVJtd2Wv/He9G3ogKsl1zsnqHbCluJ+6+K/rnIYrCOonFQfvWYghiEQizUDb5II8hMuCP2W7WZylHLjrXAMt3vP7MCnjoTLbbbPkNI2j65g2zlC/uZ3jXz/nOja+viHpEkSbp4m39rBOvytBtvO7kvar372c3ymbHAP30zApU9Qn3usdPADdpL9uiFNcfpWG/loxyCqFwThVPGjm7Bukde59SozWQWiJ0TqE+7J0Q5bmpFEC3pbv19xIj7V0Ib97Uq5AhO0SBRJ+zRKf2enUw9FUnzc5YR9HO+I89sOCgRZj5eZtWU5Y4HS4fKm5Nf+oPnSlMEHnwY2n7g+acsyAjWhrwML7O9EmniRJt4BKXrGxZCsE1lzVuavN2Hg02u+Q1Ja7hmsPQwvS3LcJxRsDx2ANmdDjMGR+mBDaKZVC1TN+c603+OqbY0iA5aHXKXefjaUjRt+/2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PreMCZSHi7XEPm3iBn4rSzWrDlji7jOpwpH9RKlrD8HQQJMcUepCBfEF/jaB86Lb8l8IDTDJSfRHQRn7DITSSZQZIjuaOtbN3lS7tq/mCu2eZ5cFh0AvgsRkM0QRYBL9nMW0qDh+9Rwu7BA5Nm+uq3mthT5rXX52CBdxKwnUKW+5pC6gSihCMYv2Zw8wDa8vefwDpbEf6x7inaQzYZoq31yHJJlSiJeYazp8SP6cBCt3vwLbPwcSD4vAAA=</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>

View File

@ -1,3 +1,5 @@
using System.Collections.ObjectModel;
namespace CodeFirstExistingDatabase.Migrations
{
using System;
@ -14,10 +16,17 @@ namespace CodeFirstExistingDatabase.Migrations
protected override void Seed(CodeFirstExistingDatabase.PlutoContext context)
{
// This method will be called after migrating to the latest version.
context.Authors.AddOrUpdate(a => a.Name,
new Author
{
Name = "Author 7",
Courses = new Collection<Course>()
{
new Course(){ Name = "Course for Author 7", Description = "Description 7"}
// You can use the DbSet<T>.AddOrUpdate() helper extension method
// to avoid creating duplicate seed data.
}
}
);
}
}
}

View File

@ -15,7 +15,6 @@ namespace CodeFirstExistingDatabase
public virtual DbSet<Author> Authors { get; set; }
public virtual DbSet<Course> Courses { get; set; }
public virtual DbSet<Tag> Tags { get; set; }
public virtual DbSet<Category> Categories { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{