Efcore: Internal code usage scenarios missed by the analyzer

Created on 7 Mar 2020  路  7Comments  路  Source: dotnet/efcore

Identified scenarios:

  • [x] Generic type parameter (e.g. context.GetService<IInMemoryStoreCache>())
  • [x] Type usage without instantiation (IStateManager state = null)
  • [x] Typeof (typeof(IInMemoryStoreCache))
  • [x] private readonly field in private nested class
  • [x] Implemented interface
area-analyzer closed-fixed type-bug

All 7 comments

May be because generic type check is missed?

Also doesn't seem to detect:
```C#
IStateManager state = null;

But does detect:
```C#
IStateManager state = new StateManager(null);

Finding more cases like this. It seems that the analyzer doesn't detect any uses of internal types/members that don't actually involve invoking anything.

@ajcvickers have converted this issue to a shopping list of currently undetected cases in the analyzer. Let's add more to it as we find them.

private readonly field in private nested class.

@smitpatel can you provide a bit more detail on "private readonly field in private nested class", possibly a code fragment?

public class A
{
    private class B
    {
        private readonly InternalEntityEntry Entry;
    }
}
Was this page helpful?
0 / 5 - 0 ratings