Im using EF6 in my dataentry program. EF does not generates ObservableCollection but HashSet and ICollection instead , so i have to change it manually. Unfortunately every time i Update Model from Database , every Many-Many relation goes back to ICollection ...
Replace ICollection and HashSet with ObservableCollection in your .tt
file.
Then search for the method public string UsingDirectives
.
In this method there should be a line includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "",
.
Replace only Generic
with ObjectModel
. This will include the correct namespace to use ObservableCollections in your models.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With