Note: I haven't tested this on Entity Framework Core, but I imagine the behavior is the same
Let's say you have the following class:
public static class BlargTypes { public static readonly string Foo = "Bar"; }
var result = dbContext.Blargs.Where(x => x.Blarg == BlargTypes.Foo);
SELECT [Id],[Blarg] FROM [Blargs] WHERE [Blarg] = @Blarg
public static class BlargTypes { public const string Foo = "Bar"; }
SELECT [Id],[Blarg] FROM [Blargs] WHERE [Blarg] = 'Foo'