Question: How to "Add a new data source" in a WPF Core application?
Â
I performed:
 - Created a WPF Core application;
 - Added the class CntDBSchool
;
 - Added the class Student
;
 - Menu Project
//" Add a new data source ";
 - Result: there is no class Student
;
Â
Class CntDBSchool
.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.EntityFrameworkCore;
Â
namespace WpfApp.Models
{
    class CntDBSchool: DbContext
    {
        public virtual DbSet <Student> Student {get; set; }
    }
}
Class Student
.
using System;
using System.Collections.Generic;
using System.Text;
Â
namespace WpfApp.Models
{
    class Student
    {
        public int StudentID {get; set; }
        public string StudentName {get; set; }
        public Nullable <int> StandardId {get; set; }
        public byte [] RowVersion {get; set; }
    }
}
Â
Table Student
.
 CREATE TABLE [dbo]. [Student] (
  [StudentID] int IDENTITY (1,1) NOT NULL,
  [StudentName] varchar (50) COLLATE Latin1_General_CI_AI NULL,
  [StandardId] int NULL,
  [RowVersion] timestamp NOT NULL,
  CONSTRAINT [PK_Student] PRIMARY KEY CLUSTERED ([StudentID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY],
  CONSTRAINT [FK_Student_Standard] FOREIGN KEY ([StandardId]) REFERENCES [dbo]. [Standard] ([StandardId]) ON DELETE CASCADE ON UPDATE NO ACTION
)
ON [PRIMARY]
Â
Â
When I do the same in the WPF Framework application, the Student class is present in the Add New Data Source window.
I do:
 - Created a WPF Framework application;
 - Created Model ADO.NET EDM
;
 - In the file DBModel.tt
replaced:
 - - line - 296 replaced ICollection
withObservableCollection
;
 - - line - 484 replaced ICollection
withObservableCollection
;
 - - line - 51 replaced HashSet
withObservableCollection
;
 - - lines - 431 replaced System.Collections.Generic
withSystem.Collections.ObjectModel
;
 - Menu Project
//" Add a new data source ";
 - Result: the class Student
is present;
Ran into this today too. Adding A datasource with a WPF Framework application works but adding a datasource with WPF Core application doesn't work. I found that someone submitted an issue back in July of 19' https://github.com/dotnet/wpf/issues/1196. They racked it up to not all features work with core.