Does C# offer some nice method to cast a single entity of type T to IEnumerable?
T
IEnumerable
The only way I can think of is something like:
var entity = new T(); var singleton = Enumerable.Repeat(entity, 1);
(Although I'd probably just do var singleton = new[] { entity }; in most situations, especially if it was only for private use.)
var singleton = new[] { entity };