So I have two tables in my db, engineer and engineerSettings. I currently have a controller for both api/username and api/userSettings, but I also want to have a controller api/userInformation that returns everything in username as well as userSettings. I'm not really sure how to go about doing this, but right now I have a new model for userInformation
public class userInformation
{
public virtual ICollection<Username> Usernames {get;set;}
punlic virtual ICollection<UserSetting> UserSettings {get;set;}
}
And in my UserInformation controller I have
....
//GET
public IEnumerable<UserInformation> GetUserInformation()
{
return db.UserInformations;
}
Which doesn't really work so I was wondering how to solve this problem?
modelBuilder.Entity<UserInformation>().ToTable("UserInformation")to my dbcontext, but still getting the same error.public virtual DbSet<UserSetting> UserSettings { get; set; }