Thanks for the insights :)
I didn’t go too deep in FluentValidation to not make this article longer.
As for the ICollection, I avoid using virtual properties to make sure that I will not enable Lazy Loading. And I always initialize collections in the constructor too avoid getting a System.NullReferenceException and can . For example, if I create a new instance of Artist like below:
var a = new Artist();
without initializing Musics collection in the constructor, and try to add a new music to the list, even with the virtual key I will get an exception.
a.Musics.Add(new Music()); // Throws System.NullReferenceException
Or try to iterate throught for some reason:
foreach(var music in a.Musics)
{
// run some code
}
Unless I assign a new list of musics to it, like this:
var musics = new Collection();
musics.Add(new Music());
a.Musics = musics;