Returning anonymous type in C# December 21, 2022 by Tarik You can’t. You can only return object, or container of objects, e.g. IEnumerable<object>, IList<object>, etc.