CS1061 'object' does not contain a definition for 'Id'
public static async Task RemoveItem<T>(object obj) where T : class, new()
{
if (obj == null || db == null)
return;
obj = obj as T;
await db.DeleteAsync<T>(obj.Id); // error
}
Is this possible to solve or have I reached the edge?
IMPORTANT: That question is marked duplicate and already closed. Nevertheless I want to share my original solution and than the result thanks to the comments.
While typing I've found the solution out :-) Thanks to Test if a property is available on a dynamic variable
EDIT after comments: