From 387bb252d141ddfd07a37bcdea301fba43857cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20=C3=96man?= Date: Sun, 10 Nov 2019 20:26:59 +0100 Subject: [PATCH] Add project files. --- CodeFirstExistingDatabase.sln | 25 ++++ CodeFirstExistingDatabase/App.config | 23 ++++ CodeFirstExistingDatabase/Author.cs | 24 ++++ CodeFirstExistingDatabase/Authors.cs | 24 ++++ .../CodeFirstExistingDatabase.csproj | 102 ++++++++++++++ CodeFirstExistingDatabase/Course.cs | 35 +++++ CodeFirstExistingDatabase/Courses.cs | 34 +++++ CodeFirstExistingDatabase/Form1.Designer.cs | 40 ++++++ CodeFirstExistingDatabase/Form1.cs | 20 +++ .../201911090857223_InitialModel.Designer.cs | 29 ++++ .../201911090857223_InitialModel.cs | 16 +++ .../201911090857223_InitialModel.resx | 126 ++++++++++++++++++ .../Migrations/Configuration.cs | 23 ++++ CodeFirstExistingDatabase/PlutoContext.cs | 32 +++++ CodeFirstExistingDatabase/Program.cs | 23 ++++ .../Properties/AssemblyInfo.cs | 36 +++++ .../Properties/Resources.Designer.cs | 71 ++++++++++ .../Properties/Resources.resx | 117 ++++++++++++++++ .../Properties/Settings.Designer.cs | 30 +++++ .../Properties/Settings.settings | 7 + CodeFirstExistingDatabase/Tag.cs | 24 ++++ CodeFirstExistingDatabase/Tags.cs | 24 ++++ CodeFirstExistingDatabase/packages.config | 4 + 23 files changed, 889 insertions(+) create mode 100644 CodeFirstExistingDatabase.sln create mode 100644 CodeFirstExistingDatabase/App.config create mode 100644 CodeFirstExistingDatabase/Author.cs create mode 100644 CodeFirstExistingDatabase/Authors.cs create mode 100644 CodeFirstExistingDatabase/CodeFirstExistingDatabase.csproj create mode 100644 CodeFirstExistingDatabase/Course.cs create mode 100644 CodeFirstExistingDatabase/Courses.cs create mode 100644 CodeFirstExistingDatabase/Form1.Designer.cs create mode 100644 CodeFirstExistingDatabase/Form1.cs create mode 100644 CodeFirstExistingDatabase/Migrations/201911090857223_InitialModel.Designer.cs create mode 100644 CodeFirstExistingDatabase/Migrations/201911090857223_InitialModel.cs create mode 100644 CodeFirstExistingDatabase/Migrations/201911090857223_InitialModel.resx create mode 100644 CodeFirstExistingDatabase/Migrations/Configuration.cs create mode 100644 CodeFirstExistingDatabase/PlutoContext.cs create mode 100644 CodeFirstExistingDatabase/Program.cs create mode 100644 CodeFirstExistingDatabase/Properties/AssemblyInfo.cs create mode 100644 CodeFirstExistingDatabase/Properties/Resources.Designer.cs create mode 100644 CodeFirstExistingDatabase/Properties/Resources.resx create mode 100644 CodeFirstExistingDatabase/Properties/Settings.Designer.cs create mode 100644 CodeFirstExistingDatabase/Properties/Settings.settings create mode 100644 CodeFirstExistingDatabase/Tag.cs create mode 100644 CodeFirstExistingDatabase/Tags.cs create mode 100644 CodeFirstExistingDatabase/packages.config diff --git a/CodeFirstExistingDatabase.sln b/CodeFirstExistingDatabase.sln new file mode 100644 index 0000000..ccd1b11 --- /dev/null +++ b/CodeFirstExistingDatabase.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29503.13 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeFirstExistingDatabase", "CodeFirstExistingDatabase\CodeFirstExistingDatabase.csproj", "{B7181C3F-54FF-45F2-9BFF-DE52A88EF3EB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B7181C3F-54FF-45F2-9BFF-DE52A88EF3EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B7181C3F-54FF-45F2-9BFF-DE52A88EF3EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7181C3F-54FF-45F2-9BFF-DE52A88EF3EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B7181C3F-54FF-45F2-9BFF-DE52A88EF3EB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B736EBDB-C5EB-44FC-8B57-4D33A2B5BEE2} + EndGlobalSection +EndGlobal diff --git a/CodeFirstExistingDatabase/App.config b/CodeFirstExistingDatabase/App.config new file mode 100644 index 0000000..3406268 --- /dev/null +++ b/CodeFirstExistingDatabase/App.config @@ -0,0 +1,23 @@ + + + + +
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CodeFirstExistingDatabase/Author.cs b/CodeFirstExistingDatabase/Author.cs new file mode 100644 index 0000000..4f888ea --- /dev/null +++ b/CodeFirstExistingDatabase/Author.cs @@ -0,0 +1,24 @@ +namespace CodeFirstExistingDatabase +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Data.Entity.Spatial; + + public partial class Author + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public Author() + { + Courses = new HashSet(); + } + + public int Id { get; set; } + + public string Name { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection Courses { get; set; } + } +} diff --git a/CodeFirstExistingDatabase/Authors.cs b/CodeFirstExistingDatabase/Authors.cs new file mode 100644 index 0000000..2bf72ba --- /dev/null +++ b/CodeFirstExistingDatabase/Authors.cs @@ -0,0 +1,24 @@ +namespace CodeFirstExistingDatabase +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Data.Entity.Spatial; + + public partial class Authors + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public Authors() + { + Courses = new HashSet(); + } + + public int Id { get; set; } + + public string Name { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection Courses { get; set; } + } +} diff --git a/CodeFirstExistingDatabase/CodeFirstExistingDatabase.csproj b/CodeFirstExistingDatabase/CodeFirstExistingDatabase.csproj new file mode 100644 index 0000000..762aa96 --- /dev/null +++ b/CodeFirstExistingDatabase/CodeFirstExistingDatabase.csproj @@ -0,0 +1,102 @@ + + + + + Debug + AnyCPU + {B7181C3F-54FF-45F2-9BFF-DE52A88EF3EB} + WinExe + CodeFirstExistingDatabase + CodeFirstExistingDatabase + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + 201911090857223_InitialModel.cs + + + + + + + + 201911090857223_InitialModel.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/CodeFirstExistingDatabase/Course.cs b/CodeFirstExistingDatabase/Course.cs new file mode 100644 index 0000000..310f0c8 --- /dev/null +++ b/CodeFirstExistingDatabase/Course.cs @@ -0,0 +1,35 @@ +namespace CodeFirstExistingDatabase +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Data.Entity.Spatial; + + [Table("Courses")] + public partial class Course + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public Course() + { + Tags = new HashSet(); + } + + public int Id { get; set; } + + public string Title { get; set; } + + public string Description { get; set; } + + public int Level { get; set; } + + public float FullPrice { get; set; } + + public int? Author_Id { get; set; } + + public virtual Author Author { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection Tags { get; set; } + } +} diff --git a/CodeFirstExistingDatabase/Courses.cs b/CodeFirstExistingDatabase/Courses.cs new file mode 100644 index 0000000..b1e9286 --- /dev/null +++ b/CodeFirstExistingDatabase/Courses.cs @@ -0,0 +1,34 @@ +namespace CodeFirstExistingDatabase +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Data.Entity.Spatial; + + public partial class Courses + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public Courses() + { + Tags = new HashSet(); + } + + public int Id { get; set; } + + public string Title { get; set; } + + public string Description { get; set; } + + public int Level { get; set; } + + public float FullPrice { get; set; } + + public int? Author_Id { get; set; } + + public virtual Authors Authors { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection Tags { get; set; } + } +} diff --git a/CodeFirstExistingDatabase/Form1.Designer.cs b/CodeFirstExistingDatabase/Form1.Designer.cs new file mode 100644 index 0000000..6d0b541 --- /dev/null +++ b/CodeFirstExistingDatabase/Form1.Designer.cs @@ -0,0 +1,40 @@ +namespace CodeFirstExistingDatabase +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "Form1"; + } + + #endregion + } +} + diff --git a/CodeFirstExistingDatabase/Form1.cs b/CodeFirstExistingDatabase/Form1.cs new file mode 100644 index 0000000..63fdccf --- /dev/null +++ b/CodeFirstExistingDatabase/Form1.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace CodeFirstExistingDatabase +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + } +} diff --git a/CodeFirstExistingDatabase/Migrations/201911090857223_InitialModel.Designer.cs b/CodeFirstExistingDatabase/Migrations/201911090857223_InitialModel.Designer.cs new file mode 100644 index 0000000..6a1d286 --- /dev/null +++ b/CodeFirstExistingDatabase/Migrations/201911090857223_InitialModel.Designer.cs @@ -0,0 +1,29 @@ +// +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 InitialModel : IMigrationMetadata + { + private readonly ResourceManager Resources = new ResourceManager(typeof(InitialModel)); + + string IMigrationMetadata.Id + { + get { return "201911090857223_InitialModel"; } + } + + string IMigrationMetadata.Source + { + get { return null; } + } + + string IMigrationMetadata.Target + { + get { return Resources.GetString("Target"); } + } + } +} diff --git a/CodeFirstExistingDatabase/Migrations/201911090857223_InitialModel.cs b/CodeFirstExistingDatabase/Migrations/201911090857223_InitialModel.cs new file mode 100644 index 0000000..44b3f00 --- /dev/null +++ b/CodeFirstExistingDatabase/Migrations/201911090857223_InitialModel.cs @@ -0,0 +1,16 @@ +namespace CodeFirstExistingDatabase.Migrations +{ + using System; + using System.Data.Entity.Migrations; + + public partial class InitialModel : DbMigration + { + public override void Up() + { + } + + public override void Down() + { + } + } +} diff --git a/CodeFirstExistingDatabase/Migrations/201911090857223_InitialModel.resx b/CodeFirstExistingDatabase/Migrations/201911090857223_InitialModel.resx new file mode 100644 index 0000000..e0f2fcc --- /dev/null +++ b/CodeFirstExistingDatabase/Migrations/201911090857223_InitialModel.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 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 + + + dbo + + \ No newline at end of file diff --git a/CodeFirstExistingDatabase/Migrations/Configuration.cs b/CodeFirstExistingDatabase/Migrations/Configuration.cs new file mode 100644 index 0000000..863e9a5 --- /dev/null +++ b/CodeFirstExistingDatabase/Migrations/Configuration.cs @@ -0,0 +1,23 @@ +namespace CodeFirstExistingDatabase.Migrations +{ + using System; + using System.Data.Entity; + using System.Data.Entity.Migrations; + using System.Linq; + + internal sealed class Configuration : DbMigrationsConfiguration + { + public Configuration() + { + AutomaticMigrationsEnabled = false; + } + + protected override void Seed(CodeFirstExistingDatabase.PlutoContext context) + { + // This method will be called after migrating to the latest version. + + // You can use the DbSet.AddOrUpdate() helper extension method + // to avoid creating duplicate seed data. + } + } +} diff --git a/CodeFirstExistingDatabase/PlutoContext.cs b/CodeFirstExistingDatabase/PlutoContext.cs new file mode 100644 index 0000000..2486762 --- /dev/null +++ b/CodeFirstExistingDatabase/PlutoContext.cs @@ -0,0 +1,32 @@ +namespace CodeFirstExistingDatabase +{ + using System; + using System.Data.Entity; + using System.ComponentModel.DataAnnotations.Schema; + using System.Linq; + + public partial class PlutoContext : DbContext + { + public PlutoContext() + : base("name=PlutoContext") + { + } + + public virtual DbSet Authors { get; set; } + public virtual DbSet Courses { get; set; } + public virtual DbSet Tags { get; set; } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + modelBuilder.Entity() + .HasMany(e => e.Courses) + .WithOptional(e => e.Author) + .HasForeignKey(e => e.Author_Id); + + modelBuilder.Entity() + .HasMany(e => e.Tags) + .WithMany(e => e.Courses) + .Map(m => m.ToTable("TagCourses").MapLeftKey("Course_Id")); + } + } +} diff --git a/CodeFirstExistingDatabase/Program.cs b/CodeFirstExistingDatabase/Program.cs new file mode 100644 index 0000000..74a170c --- /dev/null +++ b/CodeFirstExistingDatabase/Program.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace CodeFirstExistingDatabase +{ + + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/CodeFirstExistingDatabase/Properties/AssemblyInfo.cs b/CodeFirstExistingDatabase/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8223a18 --- /dev/null +++ b/CodeFirstExistingDatabase/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CodeFirstExistingDatabase")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CodeFirstExistingDatabase")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b7181c3f-54ff-45f2-9bff-de52a88ef3eb")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CodeFirstExistingDatabase/Properties/Resources.Designer.cs b/CodeFirstExistingDatabase/Properties/Resources.Designer.cs new file mode 100644 index 0000000..62dd40d --- /dev/null +++ b/CodeFirstExistingDatabase/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CodeFirstExistingDatabase.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CodeFirstExistingDatabase.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/CodeFirstExistingDatabase/Properties/Resources.resx b/CodeFirstExistingDatabase/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/CodeFirstExistingDatabase/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/CodeFirstExistingDatabase/Properties/Settings.Designer.cs b/CodeFirstExistingDatabase/Properties/Settings.Designer.cs new file mode 100644 index 0000000..7c7494f --- /dev/null +++ b/CodeFirstExistingDatabase/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CodeFirstExistingDatabase.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/CodeFirstExistingDatabase/Properties/Settings.settings b/CodeFirstExistingDatabase/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/CodeFirstExistingDatabase/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CodeFirstExistingDatabase/Tag.cs b/CodeFirstExistingDatabase/Tag.cs new file mode 100644 index 0000000..a4b557d --- /dev/null +++ b/CodeFirstExistingDatabase/Tag.cs @@ -0,0 +1,24 @@ +namespace CodeFirstExistingDatabase +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Data.Entity.Spatial; + + public partial class Tag + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public Tag() + { + Courses = new HashSet(); + } + + public int Id { get; set; } + + public string Name { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection Courses { get; set; } + } +} diff --git a/CodeFirstExistingDatabase/Tags.cs b/CodeFirstExistingDatabase/Tags.cs new file mode 100644 index 0000000..8262a0c --- /dev/null +++ b/CodeFirstExistingDatabase/Tags.cs @@ -0,0 +1,24 @@ +namespace CodeFirstExistingDatabase +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Data.Entity.Spatial; + + public partial class Tags + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public Tags() + { + Courses = new HashSet(); + } + + public int Id { get; set; } + + public string Name { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection Courses { get; set; } + } +} diff --git a/CodeFirstExistingDatabase/packages.config b/CodeFirstExistingDatabase/packages.config new file mode 100644 index 0000000..eb087a2 --- /dev/null +++ b/CodeFirstExistingDatabase/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file