none
Having Some Trouble Learning Database Code RRS feed

  • Question


  • namespace Harmony2015

    { public partial class BuildModel : Form { public BuildModel() { InitializeComponent(); } public class ImpedanceEl { public ImpedanceEl() { } public int Id { get; set; } public int Length { get; set; } public double Re_X { get; set; } // I am not sure what type of value impedance has } public class Power_Sys { public Power_Sys() { } public string Power_Sys_ID { get; set; } public ICollection<ImpedanceEl> ImpedanceEl { get; set; } } } namespace Power_System_Simulation_Harmonics { public class SystemContext : System.Data.Entity.DbContext { public SystemContext() : base() { } //PROBLEM OCCURS IN THE NEXT TWO LINES. public DbSet<ImpedanceEl> ImpedanceElements { get; set; } public DbSet<Power_Sys> PowerSystems { get; set; } } }

    I'm having some trouble with the code above.

    I'm working through the database tutorial at:

    http://www.entityframeworktutorial.net/code-first/setup-entity-framework-code-first-environment.aspx

    .

    It appears that I am missing a "class" definition,

    but I have defined the two classes above the code that has the problem.

    This seems a little mysterious.

    Can anyone help (please).

    Thank you.





    • Edited by LingJingLing Thursday, September 17, 2015 2:45 PM
    • Moved by CoolDadTx Thursday, September 17, 2015 5:27 PM EF related
    Thursday, September 17, 2015 2:41 PM

Answers

All replies