Error when attempting to create Controller from the Level1 property set and DAL.OutlineContext
Error Message
Screen Capture Here
Error Text:
There was an error running the selected code generator
No DbContext Outline.DAL.OutlineContext was found.
Included Below;
- AppSettings.json
- DAL.OutlineContext
- Models.Level1
- Models.Level2
- Models.levelJoin1
- Programming Environment
___________________________________________________________________________________________________________________________
{"Logging": {"LogLevel": {"Default": "Warning" } },"AllowedHosts": "*","ConnectionStrings": {"OutlineContext": "\"Data Source=(LocalDb)\\\\v11.0;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\\\\Outline.mdf\\\",","providerName": "System.Data.SqlClient" } // "cs": "Server=(localdb)\\mssqllocaldb;Database=cs-3e24dc9b-e3b5-4a06-b629-edeeed78359d;Trusted_Connection=True;MultipleActiveResultSets=true" } }
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Threading.Tasks;//usingOutline.Models;usingSystem.Data.Entity;usingSystem.Data.Entity.ModelConfiguration.Conventions;namespaceOutline.DAL{publicclassOutlineContext:DbContext{publicOutlineContext():base("OutlineContext")// The name of the connection string is passed in to the constructor.{}publicDbSet<Level1>Level1s{get;set;}publicDbSet<Level2>Level2s{get;set;}publicDbSet<Join1>Join1s{get;set;}protectedoverridevoidOnModelCreating(DbModelBuilder modelBuilder){ modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();}}}
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Threading.Tasks;namespaceOutline.Models{publicclassLevel1{intLevel1ID{get;set;}stringLevelString1{get;set;}publicvirtualICollection<Join1>Join1s{get;set;}}}
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Threading.Tasks;namespaceOutline.Models{publicclassLevel2{intLeve21ID{get;set;}stringLevel2String1{get;set;}publicvirtualICollection<Join1>Join1s{get;set;}}}
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Threading.Tasks;namespaceOutline.Models{publicclassJoin1{publicintJoinID{get;set;}publicintLevel1ID{get;set;}publicintLeve21ID{get;set;}publicvirtualLevel1Level1{get;set;}publicvirtualLevel2Level2{get;set;}}}