text:
Nested navigation properties not optimized SQL

I've a [Guest] entity with two navigation properties, [Country] and [City], each of which has a [CountryName]/[CityName] navigation property (each Country or City has different Names based on language).
public class Country
{
	[Key,Column(Order = 0)]
	public Guid TenantID { get; set; }
	[Key, Column(Order = 1)]
	public Guid ID { get; set; }

	public virtual List<CountryName> Names { get; set; }
}
public class CountryName
{
	[Key, Column(Order = 0)]
	public Guid TenantID { get; set; }
	[Key,Column(Order = 1)]
	public Guid CountryID { get; set; }
	[Key, Column(Order = 2)]
	[StringLength(3)]
	public string LanguageID { get; set; }
	[StringLength(255)]
	public string Name { get; set; }

	public virtual Country Country { get; set; }
}

public class City
{
	[Key, Column(Order = 0)]
	public Guid TenantID { get; set; }
	[Key, Column(Order = 1)]
	public Guid CountryID { get; set; }
	[Key, Column(Order = 2)]
	public Guid ID { get; set; }

	public virtual List<CityName> Names { get; set; }
}
public class CityName
{
	[Key, Column(Order = 0)]
	public Guid TenantID { get; set; }
	[Key, Column(Order = 1)]
	public Guid CountryID { get; set; }
	[Key,Column(Order = 2)]
	public Guid CityID { get; set; }
	[Key, Column(Order = 3)]
	[StringLength(3)]
	public string LanguageID { get; set; }
	[StringLength(255)]
	public string Name { get; set; }

	public virtual City City { get; set; }
}

public class Guest
{
	[Key, Column(Order = 0)]
	public Guid TenantID { get; set; }
	[Key, Column(Order = 1)]
	public Guid ID { get; set; }
	public Guid? BirthCountryID { get; set; }
	public virtual Country BirthCountry { get; set; }
	public Guid? BirthCityID { get; set; }
	public virtual City BirthCity { get; set; }
}

[CountryName] and [CityName] have a query filter set in context OnModelCreating.
// Country
modelBuilder.Entity<Country>().HasKey(c => new { c.TenantID, c.ID });
modelBuilder.Entity<Country>().Property(p => p.ID).ValueGeneratedOnAdd().HasDefaultValueSql("newsequentialid()");
// CountryName
modelBuilder.Entity<CountryName>().HasKey(c => new { c.TenantID, c.CountryID, c.LanguageID });
modelBuilder.Entity<CountryName>().HasOne(ho => ho.Country).WithMany(wm => wm.Names).HasForeignKey(fk => new { fk.TenantID, fk.CountryID }).OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<CountryName>().HasQueryFilter(qf => qf.LanguageID == LanguageID);

// City
modelBuilder.Entity<City>().HasKey(c => new { c.TenantID, c.CountryID, c.ID });
modelBuilder.Entity<City>().Property(p => p.ID).ValueGeneratedOnAdd().HasDefaultValueSql("newsequentialid()");
// CityName
modelBuilder.Entity<CityName>().HasKey(c => new { c.TenantID, c.CountryID, c.CityID, c.LanguageID });
modelBuilder.Entity<CityName>().HasOne(ho => ho.City).WithMany(wm => wm.Names).HasForeignKey(fk => new { fk.TenantID, fk.CountryID, fk.CityID }).OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<CityName>().HasQueryFilter(qf => qf.LanguageID == LanguageID);

// Guest
modelBuilder.Entity<Guest>().HasKey(c => new { c.TenantID, c.ID });
modelBuilder.Entity<Guest>().Property(p => p.ID).ValueGeneratedOnAdd().HasDefaultValueSql("newsequentialid()");
modelBuilder.Entity<Guest>().HasOne(ho => ho.BirthCountry).WithMany().HasForeignKey(fk => new { fk.TenantID, fk.BirthCountryID }).OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<Guest>().HasOne(ho => ho.BirthCity).WithMany().HasForeignKey(fk => new { fk.TenantID, fk.BirthCountryID, fk.BirthCityID }).OnDelete(DeleteBehavior.Restrict);

MY QUERY
var data = _context.Guests
		.Where(w => w.TenantID == TenantID && w.Cancelled == null  &&
		(w.VAT.Contains(Filter) || w.First.Contains(Filter) || w.Last.Contains(Filter) || w.BirthDate.ToString().Contains(Filter) ||
		w.ResidenceAddress.Contains(Filter) || w.BirthCountry.Names.Any(a => a.Name.Contains(Filter)) ||
		w.BirthCity.Names.Any(a => a.Name.Contains(Filter))))
		.OrderBy(o => o.ID)
		.Skip(Start).Take(Count)
		.Select(s => new
		{
			ID = s.ID,
			Name = s.FullName,
			VAT = s.VAT,
			BirthDate = s.BirthDate.ToString("yyyy/MM/dd"),
			ResidenceAddress = s.ResidenceAddress,
			BirthCountryName = s.BirthCountry.Names[0].Name,
			BirthCityName = s.BirthCity.Names[0].Name,
			Reservations = s.ReservationsNumber,
			Bookable = bookable,
			IsHospitalized = s.IsHospitalized,
			IsPresent = s.IsPresent
		})
		.AsNoTracking()
		.ToList();

GENERATED SQL
/* MAIN */
SELECT [w].[TenantID], [w].[ID], [w].[AddUserID], [w].[Added], [w].[BirthCityID], [w].[BirthCountryID], [w].[BirthDate], [w].[BirthState], [w].[CancelUserID], [w].[Cancelled], [w].[DeathDate], [w].[First], [w].[IsHospitalized], [w].[IsPresent], [w].[Last], [w].[ReservationsNumber] AS [Reservations], [w].[ResidenceAddress], [w].[ResidenceAddressNumber], [w].[ResidenceAddressState], [w].[ResidenceAddressZip], [w].[ResidenceCityID], [w].[ResidenceCountryID], [w].[SexID], [w].[UpdateUserID], [w].[Updated], [w].[VAT], [w.BirthCountry].[TenantID], [w.BirthCountry].[ID], [w.BirthCity].[TenantID], [w.BirthCity].[CountryID], [w.BirthCity].[ID]
FROM [Guests] AS [w]
LEFT JOIN [Cities] AS [w.BirthCity] ON (([w].[TenantID] = [w.BirthCity].[TenantID]) AND ([w].[BirthCountryID] = [w.BirthCity].[CountryID])) AND ([w].[BirthCityID] = [w.BirthCity].[ID])
LEFT JOIN [Countries] AS [w.BirthCountry] ON ([w].[TenantID] = [w.BirthCountry].[TenantID]) AND ([w].[BirthCountryID] = [w.BirthCountry].[ID])
WHERE (([w].[TenantID] = @__TenantID_0) AND [w].[Cancelled] IS NULL) AND ((((((((CHARINDEX(@__Filter_1, [w].[VAT]) > 0) OR (@__Filter_1 = N'')) OR ((CHARINDEX(@__Filter_2, [w].[First]) > 0) OR (@__Filter_2 = N''))) OR ((CHARINDEX(@__Filter_3, [w].[Last]) > 0) OR (@__Filter_3 = N''))) OR ((CHARINDEX(@__Filter_4, CONVERT(VARCHAR(100), [w].[BirthDate])) > 0) OR (@__Filter_4 = N''))) OR ((CHARINDEX(@__Filter_5, [w].[ResidenceAddress]) > 0) OR (@__Filter_5 = N''))) OR EXISTS (
    SELECT 1
    FROM [CountryNames] AS [qf]
    WHERE (([qf].[LanguageID] = @__ef_filter__LanguageID_0) AND ((CHARINDEX(@__Filter_6, [qf].[Name]) > 0) OR (@__Filter_6 = N''))) AND (([w.BirthCountry].[TenantID] = [qf].[TenantID]) AND ([w.BirthCountry].[ID] = [qf].[CountryID])))) OR EXISTS (
    SELECT 1
    FROM [CityNames] AS [qf0]
    WHERE (([qf0].[LanguageID] = @__ef_filter__LanguageID_1) AND ((CHARINDEX(@__Filter_7, [qf0].[Name]) > 0) OR (@__Filter_7 = N''))) AND ((([w.BirthCity].[TenantID] = [qf0].[TenantID]) AND ([w.BirthCity].[CountryID] = [qf0].[CountryID])) AND ([w.BirthCity].[ID] = [qf0].[CityID]))))
ORDER BY [w].[ID], [w].[TenantID], [w.BirthCountry].[TenantID], [w.BirthCountry].[ID], [w.BirthCity].[TenantID], [w.BirthCity].[CountryID], [w.BirthCity].[ID]
OFFSET @__p_8 ROWS FETCH NEXT @__p_9 ROWS ONLY

/* FOR >>>  [BirthCountryName = s.BirthCountry.Names[0].Name] */
SELECT [w.BirthCountry.Names].[TenantID], [w.BirthCountry.Names].[CountryID], [w.BirthCountry.Names].[LanguageID], [w.BirthCountry.Names].[Name], [t].[ID], [t].[TenantID], [t].[TenantID0], [t].[ID0]
FROM [CountryNames] AS [w.BirthCountry.Names]
INNER JOIN (
    SELECT [w0].[ID], [w0].[TenantID], [w.BirthCountry0].[TenantID] AS [TenantID0], [w.BirthCountry0].[ID] AS [ID0]
    FROM [Guests] AS [w0]
    LEFT JOIN [Cities] AS [w.BirthCity0] ON (([w0].[TenantID] = [w.BirthCity0].[TenantID]) AND ([w0].[BirthCountryID] = [w.BirthCity0].[CountryID])) AND ([w0].[BirthCityID] = [w.BirthCity0].[ID])
    LEFT JOIN [Countries] AS [w.BirthCountry0] ON ([w0].[TenantID] = [w.BirthCountry0].[TenantID]) AND ([w0].[BirthCountryID] = [w.BirthCountry0].[ID])
    WHERE (([w0].[TenantID] = @__TenantID_0) AND [w0].[Cancelled] IS NULL) AND ((((((((CHARINDEX(@__Filter_1, [w0].[VAT]) > 0) OR (@__Filter_1 = N'')) OR ((CHARINDEX(@__Filter_2, [w0].[First]) > 0) OR (@__Filter_2 = N''))) OR ((CHARINDEX(@__Filter_3, [w0].[Last]) > 0) OR (@__Filter_3 = N''))) OR ((CHARINDEX(@__Filter_4, CONVERT(VARCHAR(100), [w0].[BirthDate])) > 0) OR (@__Filter_4 = N''))) OR ((CHARINDEX(@__Filter_5, [w0].[ResidenceAddress]) > 0) OR (@__Filter_5 = N''))) OR EXISTS (
        SELECT 1
        FROM [CountryNames] AS [qf1]
        WHERE (([qf1].[LanguageID] = @__ef_filter__LanguageID_0) AND ((CHARINDEX(@__Filter_6, [qf1].[Name]) > 0) OR (@__Filter_6 = N''))) AND (([w.BirthCountry0].[TenantID] = [qf1].[TenantID]) AND ([w.BirthCountry0].[ID] = [qf1].[CountryID])))) OR EXISTS (
        SELECT 1
        FROM [CityNames] AS [qf2]
        WHERE (([qf2].[LanguageID] = @__ef_filter__LanguageID_1) AND ((CHARINDEX(@__Filter_7, [qf2].[Name]) > 0) OR (@__Filter_7 = N''))) AND ((([w.BirthCity0].[TenantID] = [qf2].[TenantID]) AND ([w.BirthCity0].[CountryID] = [qf2].[CountryID])) AND ([w.BirthCity0].[ID] = [qf2].[CityID]))))
    ORDER BY [w0].[ID], [w0].[TenantID], [w.BirthCountry0].[TenantID], [w.BirthCountry0].[ID]
    OFFSET @__p_8 ROWS FETCH NEXT @__p_9 ROWS ONLY
) AS [t] ON ([w.BirthCountry.Names].[TenantID] = [t].[TenantID0]) AND ([w.BirthCountry.Names].[CountryID] = [t].[ID0])
WHERE [w.BirthCountry.Names].[LanguageID] = @__ef_filter__LanguageID_2
ORDER BY [t].[ID], [t].[TenantID], [t].[TenantID0], [t].[ID0]

/* FOR >>> [BirthCityName = s.BirthCity.Names[0].Name]*/
SELECT [w.BirthCity.Names].[TenantID], [w.BirthCity.Names].[CountryID], [w.BirthCity.Names].[CityID], [w.BirthCity.Names].[LanguageID], [w.BirthCity.Names].[Name], [t0].[ID], [t0].[TenantID], [t0].[TenantID0], [t0].[CountryID], [t0].[ID0]
FROM [CityNames] AS [w.BirthCity.Names]
INNER JOIN (
    SELECT [w1].[ID], [w1].[TenantID], [w.BirthCity1].[TenantID] AS [TenantID0], [w.BirthCity1].[CountryID], [w.BirthCity1].[ID] AS [ID0]
    FROM [Guests] AS [w1]
    LEFT JOIN [Cities] AS [w.BirthCity1] ON (([w1].[TenantID] = [w.BirthCity1].[TenantID]) AND ([w1].[BirthCountryID] = [w.BirthCity1].[CountryID])) AND ([w1].[BirthCityID] = [w.BirthCity1].[ID])
    LEFT JOIN [Countries] AS [w.BirthCountry1] ON ([w1].[TenantID] = [w.BirthCountry1].[TenantID]) AND ([w1].[BirthCountryID] = [w.BirthCountry1].[ID])
    WHERE (([w1].[TenantID] = @__TenantID_0) AND [w1].[Cancelled] IS NULL) AND ((((((((CHARINDEX(@__Filter_1, [w1].[VAT]) > 0) OR (@__Filter_1 = N'')) OR ((CHARINDEX(@__Filter_2, [w1].[First]) > 0) OR (@__Filter_2 = N''))) OR ((CHARINDEX(@__Filter_3, [w1].[Last]) > 0) OR (@__Filter_3 = N''))) OR ((CHARINDEX(@__Filter_4, CONVERT(VARCHAR(100), [w1].[BirthDate])) > 0) OR (@__Filter_4 = N''))) OR ((CHARINDEX(@__Filter_5, [w1].[ResidenceAddress]) > 0) OR (@__Filter_5 = N''))) OR EXISTS (
        SELECT 1
        FROM [CountryNames] AS [qf3]
        WHERE (([qf3].[LanguageID] = @__ef_filter__LanguageID_0) AND ((CHARINDEX(@__Filter_6, [qf3].[Name]) > 0) OR (@__Filter_6 = N''))) AND (([w.BirthCountry1].[TenantID] = [qf3].[TenantID]) AND ([w.BirthCountry1].[ID] = [qf3].[CountryID])))) OR EXISTS (
        SELECT 1
        FROM [CityNames] AS [qf4]
        WHERE (([qf4].[LanguageID] = @__ef_filter__LanguageID_1) AND ((CHARINDEX(@__Filter_7, [qf4].[Name]) > 0) OR (@__Filter_7 = N''))) AND ((([w.BirthCity1].[TenantID] = [qf4].[TenantID]) AND ([w.BirthCity1].[CountryID] = [qf4].[CountryID])) AND ([w.BirthCity1].[ID] = [qf4].[CityID]))))
    ORDER BY [w1].[ID], [w1].[TenantID], [w.BirthCity1].[TenantID], [w.BirthCity1].[CountryID], [w.BirthCity1].[ID]
    OFFSET @__p_8 ROWS FETCH NEXT @__p_9 ROWS ONLY
) AS [t0] ON (([w.BirthCity.Names].[TenantID] = [t0].[TenantID0]) AND ([w.BirthCity.Names].[CountryID] = [t0].[CountryID])) AND ([w.BirthCity.Names].[CityID] = [t0].[ID0])
WHERE [w.BirthCity.Names].[LanguageID] = @__ef_filter__LanguageID_3
ORDER BY [t0].[ID], [t0].[TenantID], [t0].[TenantID0], [t0].[CountryID], [t0].[ID0]

QUESTION
Actually 3 query are generated, 3 resultset are returned from SQL Server (Azure) and then client side merged.
Maybe this query could be translated to a single SQL query ?
Or at least select only [Name] field from nested navigation properties ?
(specially on mobile devices any byte saved is a great achievement)
I tried
BirthCityName = s.BirthCity.Names.SingleOrDefault().Name
or
BirthCityName = s.BirthCity.Names.FirstOrDefault().Name
instead of
BirthCityName = s.BirthCity.Names[0].Name
but both aren't translated and are resolved client side, generating [Count]  (Take parameter) * 2 (Country and City) more SQL queries, two for each guest retrieved (taking 25 records EF Core generate 51 SQL queries)
Further technical details
EF Core version: 2.1.0-preview2-final
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system:  Windows 10 64 bit
IDE:  Visual Studio 2017 15.7.0 Preview 5

It doesn't translate, I change from array index to FirstOrDefault only BirthCityName and this is the result
Microsoft.EntityFrameworkCore.Query:Warning: Query: '(from CityName <generated>_1 in [w].BirthCity.Names select [<generated>_1].Name).FirstOrDefault()' uses First/FirstOrDefault/Last/LastOrDefault operation without OrderBy and filter which may lead to unpredictable results.
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (131ms) [Parameters=[@__TenantID_0='?' (DbType = Guid), @__Filter_1='?' (Size = 4000), @__Filter_2='?' (Size = 4000), @__Filter_3='?' (Size = 4000), @__Filter_4='?' (Size = 4000), @__Filter_5='?' (Size = 4000), @__ef_filter__LanguageID_0='?' (Size = 3), @__Filter_6='?' (Size = 4000), @__ef_filter__LanguageID_1='?' (Size = 3), @__Filter_7='?' (Size = 4000), @__Filter_8='?' (Size = 4000), @__p_9='?' (DbType = Int32), @__p_10='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT [w].[TenantID], [w].[ID], [w].[AddUserID], [w].[Added], [w].[BirthCityID], [w].[BirthCountryID], [w].[BirthDate], [w].[BirthState], [w].[CancelUserID], [w].[Cancelled], [w].[DeathDate], [w].[FacilityCode], [w].[First], [w].[IsHospitalized], [w].[IsPresent], [w].[Last], [w].[ReservationsNumber] AS [Reservations], [w].[ResidenceAddress], [w].[ResidenceAddressNumber], [w].[ResidenceAddressState], [w].[ResidenceAddressZip], [w].[ResidenceCityID], [w].[ResidenceCountryID], [w].[SexID], [w].[UpdateUserID], [w].[Updated], [w].[VAT], [w.BirthCountry].[TenantID], [w.BirthCountry].[ID], [w.BirthCity].[TenantID], [w.BirthCity].[CountryID], [w.BirthCity].[ID]
FROM [Guests] AS [w]
LEFT JOIN [Cities] AS [w.BirthCity] ON (([w].[TenantID] = [w.BirthCity].[TenantID]) AND ([w].[BirthCountryID] = [w.BirthCity].[CountryID])) AND ([w].[BirthCityID] = [w.BirthCity].[ID])
LEFT JOIN [Countries] AS [w.BirthCountry] ON ([w].[TenantID] = [w.BirthCountry].[TenantID]) AND ([w].[BirthCountryID] = [w.BirthCountry].[ID])
WHERE (([w].[TenantID] = @__TenantID_0) AND [w].[Cancelled] IS NULL) AND (((((((((CHARINDEX(@__Filter_1, [w].[VAT]) > 0) OR (@__Filter_1 = N'')) OR ((CHARINDEX(@__Filter_2, [w].[First]) > 0) OR (@__Filter_2 = N''))) OR ((CHARINDEX(@__Filter_3, [w].[Last]) > 0) OR (@__Filter_3 = N''))) OR ((CHARINDEX(@__Filter_4, CONVERT(VARCHAR(100), [w].[BirthDate])) > 0) OR (@__Filter_4 = N''))) OR ((CHARINDEX(@__Filter_5, [w].[ResidenceAddress]) > 0) OR (@__Filter_5 = N''))) OR EXISTS (
    SELECT 1
    FROM [CountryNames] AS [qf]
    WHERE (([qf].[LanguageID] = @__ef_filter__LanguageID_0) AND ((CHARINDEX(@__Filter_6, [qf].[Name]) > 0) OR (@__Filter_6 = N''))) AND (([w.BirthCountry].[TenantID] = [qf].[TenantID]) AND ([w.BirthCountry].[ID] = [qf].[CountryID])))) OR EXISTS (
    SELECT 1
    FROM [CityNames] AS [qf0]
    WHERE (([qf0].[LanguageID] = @__ef_filter__LanguageID_1) AND ((CHARINDEX(@__Filter_7, [qf0].[Name]) > 0) OR (@__Filter_7 = N''))) AND ((([w.BirthCity].[TenantID] = [qf0].[TenantID]) AND ([w.BirthCity].[CountryID] = [qf0].[CountryID])) AND ([w.BirthCity].[ID] = [qf0].[CityID])))) OR ((CHARINDEX(@__Filter_8, [w].[FacilityCode]) > 0) OR (@__Filter_8 = N'')))
ORDER BY [w].[ID], [w].[TenantID], [w.BirthCountry].[TenantID], [w.BirthCountry].[ID]
OFFSET @__p_9 ROWS FETCH NEXT @__p_10 ROWS ONLY
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (92ms) [Parameters=[@__TenantID_0='?' (DbType = Guid), @__Filter_1='?' (Size = 4000), @__Filter_2='?' (Size = 4000), @__Filter_3='?' (Size = 4000), @__Filter_4='?' (Size = 4000), @__Filter_5='?' (Size = 4000), @__ef_filter__LanguageID_0='?' (Size = 3), @__Filter_6='?' (Size = 4000), @__ef_filter__LanguageID_1='?' (Size = 3), @__Filter_7='?' (Size = 4000), @__Filter_8='?' (Size = 4000), @__p_9='?' (DbType = Int32), @__p_10='?' (DbType = Int32), @__ef_filter__LanguageID_2='?' (Size = 3)], CommandType='Text', CommandTimeout='30']
SELECT [w.BirthCountry.Names].[TenantID], [w.BirthCountry.Names].[CountryID], [w.BirthCountry.Names].[LanguageID], [w.BirthCountry.Names].[Name], [t].[ID], [t].[TenantID], [t].[TenantID0], [t].[ID0]
FROM [CountryNames] AS [w.BirthCountry.Names]
INNER JOIN (
    SELECT [w0].[ID], [w0].[TenantID], [w.BirthCountry0].[TenantID] AS [TenantID0], [w.BirthCountry0].[ID] AS [ID0]
    FROM [Guests] AS [w0]
    LEFT JOIN [Cities] AS [w.BirthCity0] ON (([w0].[TenantID] = [w.BirthCity0].[TenantID]) AND ([w0].[BirthCountryID] = [w.BirthCity0].[CountryID])) AND ([w0].[BirthCityID] = [w.BirthCity0].[ID])
    LEFT JOIN [Countries] AS [w.BirthCountry0] ON ([w0].[TenantID] = [w.BirthCountry0].[TenantID]) AND ([w0].[BirthCountryID] = [w.BirthCountry0].[ID])
    WHERE (([w0].[TenantID] = @__TenantID_0) AND [w0].[Cancelled] IS NULL) AND (((((((((CHARINDEX(@__Filter_1, [w0].[VAT]) > 0) OR (@__Filter_1 = N'')) OR ((CHARINDEX(@__Filter_2, [w0].[First]) > 0) OR (@__Filter_2 = N''))) OR ((CHARINDEX(@__Filter_3, [w0].[Last]) > 0) OR (@__Filter_3 = N''))) OR ((CHARINDEX(@__Filter_4, CONVERT(VARCHAR(100), [w0].[BirthDate])) > 0) OR (@__Filter_4 = N''))) OR ((CHARINDEX(@__Filter_5, [w0].[ResidenceAddress]) > 0) OR (@__Filter_5 = N''))) OR EXISTS (
        SELECT 1
        FROM [CountryNames] AS [qf1]
        WHERE (([qf1].[LanguageID] = @__ef_filter__LanguageID_0) AND ((CHARINDEX(@__Filter_6, [qf1].[Name]) > 0) OR (@__Filter_6 = N''))) AND (([w.BirthCountry0].[TenantID] = [qf1].[TenantID]) AND ([w.BirthCountry0].[ID] = [qf1].[CountryID])))) OR EXISTS (
        SELECT 1
        FROM [CityNames] AS [qf2]
        WHERE (([qf2].[LanguageID] = @__ef_filter__LanguageID_1) AND ((CHARINDEX(@__Filter_7, [qf2].[Name]) > 0) OR (@__Filter_7 = N''))) AND ((([w.BirthCity0].[TenantID] = [qf2].[TenantID]) AND ([w.BirthCity0].[CountryID] = [qf2].[CountryID])) AND ([w.BirthCity0].[ID] = [qf2].[CityID])))) OR ((CHARINDEX(@__Filter_8, [w0].[FacilityCode]) > 0) OR (@__Filter_8 = N'')))
    ORDER BY [w0].[ID], [w0].[TenantID], [w.BirthCountry0].[TenantID], [w.BirthCountry0].[ID]
    OFFSET @__p_9 ROWS FETCH NEXT @__p_10 ROWS ONLY
) AS [t] ON ([w.BirthCountry.Names].[TenantID] = [t].[TenantID0]) AND ([w.BirthCountry.Names].[CountryID] = [t].[ID0])
WHERE [w.BirthCountry.Names].[LanguageID] = @__ef_filter__LanguageID_2
ORDER BY [t].[ID], [t].[TenantID], [t].[TenantID0], [t].[ID0]
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (79ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (67ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (66ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (80ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (69ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (68ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (66ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (69ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (70ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (68ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (66ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (87ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (66ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (67ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (68ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (68ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (66ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (79ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (89ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (101ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (87ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (70ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (65ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (71ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (70ms) [Parameters=[@__ef_filter__LanguageID_3='?' (Size = 3), @_outer_TenantID='?' (DbType = Guid), @_outer_CountryID='?' (DbType = Guid), @_outer_ID='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [qf4].[Name]
FROM [CityNames] AS [qf4]
WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID = [qf4].[CityID]))
Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (97ms) [Parameters=[@__TenantID_0='?' (DbType = Guid), @__Filter_1='?' (Size = 4000), @__Filter_2='?' (Size = 4000), @__Filter_3='?' (Size = 4000), @__Filter_4='?' (Size = 4000), @__Filter_5='?' (Size = 4000), @__ef_filter__LanguageID_0='?' (Size = 3), @__Filter_6='?' (Size = 4000), @__ef_filter__LanguageID_1='?' (Size = 3), @__Filter_7='?' (Size = 4000), @__Filter_8='?' (Size = 4000)], CommandType='Text', CommandTimeout='30']

And at the beginning I got this warning (it doesn't consider it as navigation property, filter should be set automatically, idem for language query filter)

Microsoft.EntityFrameworkCore.Query:Warning: Query: '(from CityName _1 in [w].BirthCity.Names select [_1].Name).FirstOrDefault()' uses First/FirstOrDefault/Last/LastOrDefault operation without OrderBy and filter which may lead to unpredictable results.

Array index instead translate as you see in the first post, bad.

Based on bits and pieces of data posted above,
Following query
var data = db.Set<Guest>()
                        .Where(w => w.TenantID == TenantID && w.Cancelled == null &&
                        (w.VAT.Contains(Filter) || w.First.Contains(Filter) || w.Last.Contains(Filter)
                        || w.BirthDate.ToString().Contains(Filter) ||
                        w.ResidenceAddress.Contains(Filter) || w.BirthCountry.Names.Any(a => a.Name.Contains(Filter)) ||
                        w.BirthCity.Names.Any(a => a.Name.Contains(Filter))))
                        .OrderBy(o => o.ID)
                        .Skip(0).Take(10)
                        .Select(s => new
                        {
                            ID = s.ID,
                            Name = s.FullName,
                            VAT = s.VAT,
                            BirthDate = s.BirthDate.ToString("yyyy/MM/dd"),
                            ResidenceAddress = s.ResidenceAddress,
                            BirthCountryName = s.BirthCountry.Names.FirstOrDefault().Name,
                            BirthCityName = s.BirthCity.Names.FirstOrDefault().Name,
                            Reservations = s.ReservationsNumber,
                            Bookable = s.Bookable,
                            IsHospitalized = s.IsHospitalized,
                            IsPresent = s.IsPresent
                        })
                        .AsNoTracking()
                        .ToList();

Generates this SQL
  SELECT [w].[ID], [w].[FullName] AS [Name], [w].[VAT], [w].[BirthDate], [w].[ResidenceAddress], (
      SELECT TOP(1) [qf1].[Name]
      FROM [CountryName] AS [qf1]
      WHERE [qf1].[LanguageID] IS NULL AND (([w.BirthCountry].[TenantID] = [qf1].[TenantID]) AND ([w.BirthCountry].[ID] = [qf1].[CountryID]))
  ) AS [BirthCountryName], (
      SELECT TOP(1) [qf2].[Name]
      FROM [CityName] AS [qf2]
      WHERE [qf2].[LanguageID] IS NULL AND ((([w.BirthCity].[TenantID] = [qf2].[TenantID]) AND ([w.BirthCity].[CountryID] = [qf2].[CountryID])) AND ([w.BirthCity].[ID] = [qf2].[CityID]))
  ) AS [BirthCityName], [w].[ReservationsNumber] AS [Reservations], [w].[Bookable], [w].[IsHospitalized], [w].[IsPresent]
  FROM [Guest] AS [w]
  LEFT JOIN [City] AS [w.BirthCity] ON (([w].[TenantID] = [w.BirthCity].[TenantID]) AND ([w].[BirthCountryID] = [w.BirthCity].[CountryID])) AND ([w].[BirthCityID] = [w.BirthCity].[ID])
  LEFT JOIN [Country] AS [w.BirthCountry] ON ([w].[TenantID] = [w.BirthCountry].[TenantID]) AND ([w].[BirthCountryID] = [w.BirthCountry].[ID])
  WHERE (([w].[TenantID] = @__TenantID_0) AND [w].[Cancelled] IS NULL) AND ((((((((CHARINDEX(@__Filter_1, [w].[VAT]) > 0) OR (@__Filter_1 = N'')) OR ((CHARINDEX(@__Filter_2, [w].[First]) > 0) OR (@__Filter_2 = N''))) OR ((CHARINDEX(@__Filter_3, [w].[Last]) > 0) OR (@__Filter_3 = N''))) OR ((CHARINDEX(@__Filter_4, CONVERT(VARCHAR(100), [w].[BirthDate])) > 0) OR (@__Filter_4 = N''))) OR ((CHARINDEX(@__Filter_5, [w].[ResidenceAddress]) > 0) OR (@__Filter_5 = N''))) OR EXISTS (
      SELECT 1
      FROM [CountryName] AS [qf]
      WHERE ([qf].[LanguageID] IS NULL AND ((CHARINDEX(@__Filter_6, [qf].[Name]) > 0) OR (@__Filter_6 = N''))) AND (([w.BirthCountry].[TenantID] = [qf].[TenantID]) AND ([w.BirthCountry].[ID] = [qf].[CountryID])))) OR EXISTS (
      SELECT 1
      FROM [CityName] AS [qf0]
      WHERE ([qf0].[LanguageID] IS NULL AND ((CHARINDEX(@__Filter_7, [qf0].[Name]) > 0) OR (@__Filter_7 = N''))) AND ((([w.BirthCity].[TenantID] = [qf0].[TenantID]) AND ([w.BirthCity].[CountryID] = [qf0].[CountryID])) AND ([w.BirthCity].[ID] = [qf0].[CityID]))))
  ORDER BY [w].[ID]
  OFFSET @__p_8 ROWS FETCH NEXT @__p_9 ROWS ONLY

Both the collection FirstOrDefault properties are lifted as expected. (tested with 2.0.1 & 2.1.0-rc1 packages)
This is the repro code I used https://gist.github.com/smitpatel/d7dda5ca29a618c9cbd236a2683e73ae
Please post a full repro project which demonstrate the issue you are seeing so we can investigate further.

Ok, found the problem.
Actually this is my real [Guest] entity
    public class Guest
    {
        [Key, Column(Order = 0)]
        public Guid TenantID { get; set; }
        [Key, Column(Order = 1)]
        public Guid ID { get; set; }
        public Guid? BirthCountryID { get; set; }
        public virtual Country BirthCountry { get; set; }
        public Guid? BirthCityID { get; set; }
        public virtual City BirthCity { get; set; }
        public DateTime? Cancelled { get; set; }
        public string VAT { get; set; }
        public string First { get; set; }
        public string Last { get; set; }
        public DateTime BirthDate { get; set; }
        public string ResidenceAddress { get; set; }
        [NotMapped]
        public string FullName => First + " " + Last;
        public bool IsHospitalized { get; set; }
        public bool IsPresent { get; set; }
        public short ReservationsNumber { get; set; }
    }

FullName property is a [NotMapped] expression bodied member, and this is the problem.
If I return s.Last or s.First SQL is generated correctly, instead if I use s.FullName, I got:

if no record found this SQL

SELECT [w].[TenantID], [w].[ID], [w].[BirthCityID], [w].[BirthCountryID], [w].[BirthDate], [w].[Cancelled], [w].[First], [w].[IsHospitalized],
[w].[IsPresent], [w].[Last], [w].[ReservationsNumber] AS [Reservations], [w].[ResidenceAddress], [w].[VAT], [w.BirthCountry].[TenantID],
[w.BirthCountry].[ID], [w.BirthCity].[TenantID], [w.BirthCity].[CountryID], [w.BirthCity].[ID]
FROM [Guests] AS [w]
LEFT JOIN [Cities] AS [w.BirthCity] ON (([w].[TenantID] = [w.BirthCity].[TenantID]) AND ([w].[BirthCountryID] = [w.BirthCity].[CountryID])) AND ([w].[BirthCityID] = [w.BirthCity].[ID])
LEFT JOIN [Countries] AS [w.BirthCountry] ON ([w].[TenantID] = [w.BirthCountry].[TenantID]) AND ([w].[BirthCountryID] = [w.BirthCountry].[ID])
WHERE (([w].[TenantID] = @__TenantID_0) AND [w].[Cancelled] IS NULL) AND ((((((((CHARINDEX(@__Filter_1, [w].[VAT]) > 0) OR (@__Filter_1 = N'')) OR
  ((CHARINDEX(@__Filter_2, [w].[First]) > 0) OR (@__Filter_2 = N''))) OR ((CHARINDEX(@__Filter_3, [w].[Last]) > 0) OR (@__Filter_3 = N''))) OR
  ((CHARINDEX(@__Filter_4, CONVERT(VARCHAR(100), [w].[BirthDate])) > 0) OR (@__Filter_4 = N''))) OR ((CHARINDEX(@__Filter_5, [w].[ResidenceAddress]) > 0) OR
  (@__Filter_5 = N''))) OR EXISTS (
	  SELECT 1
	  FROM [CountryNames] AS [qf]
	  WHERE (([qf].[LanguageID] = @__ef_filter__LanguageID_0) AND ((CHARINDEX(@__Filter_6, [qf].[Name]) > 0) OR (@__Filter_6 = N''))) AND (([w.BirthCountry].[TenantID] = [qf].[TenantID]) AND
	  ([w.BirthCountry].[ID] = [qf].[CountryID])))) OR EXISTS (
	  SELECT 1
	  FROM [CityNames] AS [qf0]
	  WHERE (([qf0].[LanguageID] = @__ef_filter__LanguageID_1) AND ((CHARINDEX(@__Filter_7, [qf0].[Name]) > 0) OR (@__Filter_7 = N''))) AND ((([w.BirthCity].[TenantID] = [qf0].[TenantID]) AND
	  ([w.BirthCity].[CountryID] = [qf0].[CountryID])) AND ([w.BirthCity].[ID] = [qf0].[CityID]))))
ORDER BY [w].[ID]
OFFSET @__p_8 ROWS FETCH NEXT @__p_9 ROWS ONLY

if it found some records (10 in this case)

SELECT [w].[TenantID], [w].[ID], [w].[BirthCityID], [w].[BirthCountryID], [w].[BirthDate], [w].[Cancelled], [w].[First], [w].[IsHospitalized], [w].[IsPresent], [w].[Last], [w].[ReservationsNumber] AS [Reservations], [w].[ResidenceAddress], [w].[VAT], [w.BirthCountry].[TenantID], [w.BirthCountry].[ID], [w.BirthCity].[TenantID], [w.BirthCity].[CountryID], [w.BirthCity].[ID]
     FROM [Guests] AS [w]
     LEFT JOIN [Cities] AS [w.BirthCity] ON (([w].[TenantID] = [w.BirthCity].[TenantID]) AND ([w].[BirthCountryID] = [w.BirthCity].[CountryID])) AND ([w].[BirthCityID] = [w.BirthCity].[ID])
     LEFT JOIN [Countries] AS [w.BirthCountry] ON ([w].[TenantID] = [w.BirthCountry].[TenantID]) AND ([w].[BirthCountryID] = [w.BirthCountry].[ID])
     WHERE (([w].[TenantID] = @__TenantID_0) AND [w].[Cancelled] IS NULL) AND ((((((((CHARINDEX(@__Filter_1, [w].[VAT]) > 0) OR (@__Filter_1 = N'')) OR ((CHARINDEX(@__Filter_2, [w].[First]) > 0) OR (@__Filter_2 = N''))) OR ((CHARINDEX(@__Filter_3, [w].[Last]) > 0) OR (@__Filter_3 = N''))) OR ((CHARINDEX(@__Filter_4, CONVERT(VARCHAR(100), [w].[BirthDate])) > 0) OR (@__Filter_4 = N''))) OR ((CHARINDEX(@__Filter_5, [w].[ResidenceAddress]) > 0) OR (@__Filter_5 = N''))) OR EXISTS (
         SELECT 1
         FROM [CountryNames] AS [qf]
         WHERE (([qf].[LanguageID] = @__ef_filter__LanguageID_0) AND ((CHARINDEX(@__Filter_6, [qf].[Name]) > 0) OR (@__Filter_6 = N''))) AND (([w.BirthCountry].[TenantID] = [qf].[TenantID]) AND ([w.BirthCountry].[ID] = [qf].[CountryID])))) OR EXISTS (
         SELECT 1
         FROM [CityNames] AS [qf0]
         WHERE (([qf0].[LanguageID] = @__ef_filter__LanguageID_1) AND ((CHARINDEX(@__Filter_7, [qf0].[Name]) > 0) OR (@__Filter_7 = N''))) AND ((([w.BirthCity].[TenantID] = [qf0].[TenantID]) AND ([w.BirthCity].[CountryID] = [qf0].[CountryID])) AND ([w.BirthCity].[ID] = [qf0].[CityID]))))
     ORDER BY [w].[ID]
     OFFSET @__p_8 ROWS FETCH NEXT @__p_9 ROWS ONLY
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (62ms) [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='6ff2b8b9-1e33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (78ms) [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='6ff2b8b9-1e33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (60ms) [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='f99211dc-2233-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (150ms) [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='f99211dc-2233-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (76ms) [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='2011ddc9-2133-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (59ms) [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='2011ddc9-2133-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (60ms) [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='7b099afd-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (58ms) [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='7b099afd-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (66ms) [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='ba1869f1-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (59ms) [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='ba1869f1-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (58ms) [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='4a625300-2333-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (87ms) [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='4a625300-2333-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (57ms) [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='c45d7119-2033-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (59ms) [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='c45d7119-2033-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (57ms) [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='ba1869f1-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (67ms) [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='ba1869f1-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (58ms) [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='75f2b8b9-1e33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (59ms) [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='75f2b8b9-1e33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (59ms) [Parameters=[@__ef_filter__LanguageID_2='it' (Size = 3), @_outer_TenantID='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_ID='a6245729-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf3].[Name]
     FROM [CountryNames] AS [qf3]
     WHERE ([qf3].[LanguageID] = @__ef_filter__LanguageID_2) AND ((@_outer_TenantID = [qf3].[TenantID]) AND (@_outer_ID = [qf3].[CountryID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000]
     Opening connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001]
     Opened connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
     Executing DbCommand [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='72099afd-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
     Executed DbCommand (77ms) [Parameters=[@__ef_filter__LanguageID_3='it' (Size = 3), @_outer_TenantID1='ca40afca-1a33-e811-80c2-0003ff5302d4', @_outer_CountryID='a6245729-1d33-e811-80c2-0003ff5302d4', @_outer_ID1='72099afd-1d33-e811-80c2-0003ff5302d4'], CommandType='Text', CommandTimeout='30']
     SELECT TOP(1) [qf4].[Name]
     FROM [CityNames] AS [qf4]
     WHERE ([qf4].[LanguageID] = @__ef_filter__LanguageID_3) AND (((@_outer_TenantID1 = [qf4].[TenantID]) AND (@_outer_CountryID = [qf4].[CountryID])) AND (@_outer_ID1 = [qf4].[CityID]))
dbug: Microsoft.EntityFrameworkCore.Database.Command[20300]
     A data reader was disposed.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002]
     Closing connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003]
     Closed connection to database 'MyDatabase' on server 'tcp:mydatabase.database.windows.net,1433'.
dbug: Microsoft.EntityFrameworkCore.Infrastructure[10407]
     'MyContext' disposed.
Program finished.

repo: aspnet/EntityFrameworkCore


text:
InMemory PrimaryKeyGeneration creating duplicates for different contexts with the same databaseName and databaseRoot

I have described the issue initially here:
https://github.com/aspnet/EntityFramework.Docs/issues/1374
When adding a second entity from the inherited class when a first entity was created in the base class gives the following error since the ID of the entity being added is being set to 1 which already exists:
Exception message:
System.InvalidOperationException: 'The instance of entity type 'OperationsSchedule' cannot be tracked because another instance with the same key value for {'OperationsScheduleID'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.'
Stack trace:

Steps to reproduce
https://github.com/foz1284/EntityFrameworkInMemoryInheritanceTest
Further technical details
EF Core version: 2.2.3
Database Provider: InMemory
Operating system: Windows10
IDE: Visual Studio 2017 15.9.7

@foz1284 The issue with duplicate IDs is a duplicate of #14646 which is fixed for 3.0. However, I doubt that this will work even with that fix because the two contexts are using different models. (It's possibly it could work if the inherited context creates the in-memory database and the base context just uses it, but it still wouldn't be recommended.)
Leaving open to discuss with the team if this is something it makes sense to support.

Hi Arthur, thanks for the reply, sorry I didn't spot the duplicate,
I had a feeling this may have been fixed as I built from source on Saturday to try and reproduce and possibly fix but the test worked successfully(It wasn't working on the nuget beta), I hadn't done enough testing to comment back on here, sorry this is my first time attempting to contribute to a high profile project in any way!
Would you be able to explain why this may not be recommended? Inheriting the context allows me to have a core database and be flexible where my customers that have specific extensions?
This is also working for me with SQL Server.
Thanks

@foz1284 Because the shape of the in-memory database is copied from the model and is implemented in terms of the model. For example, accessing a property is done through the index of that property in the EF model. For this to work with multiple models in a realizable way would require that the the in-memory database have an extra layer which abstracts the EF model from some less tightly coupled lower layer.
Have you considered using SQLite? It supports an in-memory mode that is closer to a real relational database.

Thanks for the explanation,
I'd seen the SQLite in memory mode but not spent any time evaluating as in memory was working fine for me before I refactored for inheritance last week, I will look into this option.

We discussed this in triage and decided that this would be a major change for the in-memory provider and compared to other things we could do does not provide enough value. SQLite (or another database with in-memory support) is the way to go here.

source: gharchive/issue

license: MIT

license_type: permissive

license_source: github-api


text:
Test failure: Options test fails on en-GB localised machine

Describe the bug
On a computer where an en-GB locale is used the Configure_GetsNullableOptionsFromConfiguration(...) tests fail.
Microsoft.Extensions.Options.Tests.OptionsTest.Configure_GetsNullableOptionsFromConfiguration(configValues: [[MyNullableBool, false], [MyNullableInt, -1], [MyNullableDateTime, 31/12/1995]], expectedValues: [[MyNullableBool, False], [MyNullableInt, -1], [MyNullableDateTime, 31/12/1995 00:00:00]])
System.InvalidOperationException : Failed to convert '31/12/1995' to type 'System.DateTime'.\r\n---- System.FormatException : 31/12/1995 is not a valid value for DateTime.\r\n-------- System.FormatException : String '31/12/1995' was not recognized as a valid DateTime.
   at Microsoft.Extensions.Configuration.ConfigurationBinder.BindInstance(Type type, Object instance, IConfiguration config, BinderOptions options) in C:\Coding\aspnet\Extensions\src\Configuration\Config.Binder\src\ConfigurationBinder.cs:line 303
   at Microsoft.Extensions.Configuration.ConfigurationBinder.BindProperty(PropertyInfo property, Object instance, IConfiguration config, BinderOptions options) in C:\Coding\aspnet\Extensions\src\Configuration\Config.Binder\src\ConfigurationBinder.cs:line 209
   at Microsoft.Extensions.Configuration.ConfigurationBinder.BindNonScalar(IConfiguration configuration, Object instance, BinderOptions options) in C:\Coding\aspnet\Extensions\src\Configuration\Config.Binder\src\ConfigurationBinder.cs:line 184
   at Microsoft.Extensions.Configuration.ConfigurationBinder.BindInstance(Type type, Object instance, IConfiguration config, BinderOptions options) in C:\Coding\aspnet\Extensions\src\Configuration\Config.Binder\src\ConfigurationBinder.cs:line 342
   at Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration configuration, Object instance, Action`1 configureOptions) in C:\Coding\aspnet\Extensions\src\Configuration\Config.Binder\src\ConfigurationBinder.cs:line 119
   at Microsoft.Extensions.Options.NamedConfigureFromConfigurationOptions`1.<>c__DisplayClass1_0.<.ctor>b__0(TOptions options) in C:\Coding\aspnet\Extensions\src\Options\ConfigurationExtensions\src\NamedConfigureFromConfigurationOptions.cs:line 32
   at Microsoft.Extensions.Options.ConfigureNamedOptions`1.Configure(String name, TOptions options) in C:\Coding\aspnet\Extensions\src\Options\Options\src\ConfigureNamedOptions.cs:line 50
   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name) in C:\Coding\aspnet\Extensions\src\Options\Options\src\OptionsFactory.cs:line 49
   at Microsoft.Extensions.Options.OptionsManager`1.<>c__DisplayClass5_0.<Get>b__0() in C:\Coding\aspnet\Extensions\src\Options\Options\src\OptionsManager.cs:line 43
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Microsoft.Extensions.Options.OptionsCache`1.GetOrAdd(String name, Func`1 createOptions) in C:\Coding\aspnet\Extensions\src\Options\Options\src\OptionsCache.cs:line 35
   at Microsoft.Extensions.Options.OptionsManager`1.Get(String name) in C:\Coding\aspnet\Extensions\src\Options\Options\src\OptionsManager.cs:line 43
   at Microsoft.Extensions.Options.OptionsManager`1.get_Value() in C:\Coding\aspnet\Extensions\src\Options\Options\src\OptionsManager.cs:line 31
   at Microsoft.Extensions.Options.Tests.OptionsTest.Configure_GetsNullableOptionsFromConfiguration(IDictionary`2 configValues, IDictionary`2 expectedValues) in C:\Coding\aspnet\Extensions\src\Options\test\OptionsTest.cs:line 234
----- Inner Stack Trace -----
   at System.ComponentModel.DateTimeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at System.ComponentModel.TypeConverter.ConvertFromInvariantString(String text)
   at Microsoft.Extensions.Configuration.ConfigurationBinder.TryConvertValue(Type type, String value, Object& result, Exception& error) in C:\Coding\aspnet\Extensions\src\Configuration\Config.Binder\src\ConfigurationBinder.cs:line 511
----- Inner Stack Trace -----
   at System.DateTimeParse.Parse(ReadOnlySpan`1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
   at System.DateTime.Parse(String s, IFormatProvider provider)
   at System.ComponentModel.DateTimeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)

To Reproduce
Run build.cmd -test on a Windows machine using the en-GB locale.
Expected behavior
The test passes.

See #1204.

Or should the config binder be culture sensitive? @HaoK?
Having to write all my config dates in InvariantCulture would get annoying. I expect that extends to number formats, etc..

I did consider that, but then that was a turn into an app compatibility thing that I didn't want to get into straight away.

InvariantCulture is usually the right thing for config data. You don't want that varying "randomly" based on whatever culture is set on some random machine.

authors: Eilon Tratcher martincostello

repo: aspnet/Extensions


text:
Add yaml configuration provider

Hello.
Microsoft.Extensions.Configuration assemblies contain many configuration providers including ini, xml and json configuration. Also the json configuration is actually used as one of default config sources when creating hosts.
However, I propose to also add the yaml configuration provider. In my experience yaml is easier to read, understand and edit, is more human readable for the specific case of configuration files.
Json editing feels more error prone, for the reason of possible missing or extra commas or brackets, need to quote every name including json object keys, etc. My example is editing /etc/docker/daemon.json.

See https://github.com/aspnet/Extensions/issues/2659, https://github.com/aspnet/Extensions/issues/1904, etc.

authors: gfoidl webczat


text:
Need a way to handle authorization for static files

From @danroth27 on Thursday, September 24, 2015 11:18:42 AM
In ASP.NET 4.6 you can use the Authorization module to handle authorization for static file requests. We need some what to handle authorization for static files in ASP.NET 5.
@blowdart
Copied from original issue: aspnet/StaticFiles#70

From @blowdart on Thursday, September 24, 2015 11:21:47 AM
My feeling here is we don't want yet another middleware for this. The Static File middleware should detect the authorization service and enable configuration of policies by path, file type, regex (kidding - NO REGEX) or whatever other filtering mechanism they wish to implement.
Pushing responsibility off to another middleware, which then becomes order dependent is a path of failure and undiscoverable for most users.

From @longday24 on Saturday, April 9, 2016 6:51:53 AM
What if UseStaticFiles() excepted optional string param of a named authorizationPolicy when passing requestpath?
public void ConfigureServices(IServiceCollection services) {     services.AddAuthentication();     services.AddAuthorization(options =>     {         options.AddPolicy("Authenticated", policy => policy.RequireAuthenticatedUser());     }); }
usage would be something like .UseStaticFiles("requestPath", "Authenticated");

From @kyse on Thursday, June 29, 2017 1:59:57 PM
Just to push this along figured I'd throw this out there.
Create a StaticFileAuthorizationRequirement file that inherits IAuthorizationRequirement for developers to build AuthorizationHandleres against.  Not essential, we can realistically pass in any requirement in updated options, there's not really a need for injecting anything specific to this library to the requirement except for is it authorizing a directory browser or static file request, which can just be checked against the context.Resource parameter in the handler.
Update SharedOptions and SharedOptionsBase to provide IEnumerable AuthenticationSchemes, IEnumerable AuthorizationRequirements, and bool AllowAnonymous properties.
In Helpers.cs:
        internal static bool IsAuthenticated(this HttpContext context, SharedOptionsBase options)
        {
            if (options.AllowAnonymous)
                return true;

            var authSchemes = options.AuthenticationSchemes ?? context.Authentication.GetAuthenticationSchemes().Select(desc => desc.AuthenticationScheme).ToArray();

            foreach (var authScheme in authSchemes)
            {
                var cp = context.Authentication.AuthenticateAsync(authScheme).Result;
                if (cp == null) continue;
                context.User = cp;
                break;
            }
            return (context.User != null && context.User.Identity.IsAuthenticated);
        }

        internal static bool IsAuthorized(this HttpContext context, ILibrary library, SharedOptionsBase options)
        {
            return options.AllowAnonymous ||
                   !options.AuthorizationRequirements.Any() ||
                   context.RequestServices.GetService<IAuthorizationService>().AuthorizeAsync(context.User, library, options.AuthorizationRequirements).Result;
        }

In the directory browser and static file middleware, update body to include calls to authenticate and authorize.
DirectoryBrowserMiddleware:
            if (!context.IsAuthenticated(_options))
            {
                context.Response.StatusCode = 401;
                return Constants.CompletedTask;
            }

            if (!context.IsAuthorized(library, _options))
            {
                context.Response.StatusCode = 403;
                return Constants.CompletedTask;
            }

StaticFileMiddleware:
            else if (!fileContext.LookupFileInfo())
            {
                _logger.LogFileNotFound(fileContext.SubPath);
            }
            else
            {
                if (!context.IsAuthenticated(_options))
                {
                    _logger.LogNotAuthenticated(fileContext.Library.Name, fileContext.SubPath);
                    return fileContext.SendStatusAsync(Constants.Status401NotAuthenticated);
                }
                if (!context.IsAuthorized(fileContext.Library, _options))
                {
                    _logger.LogNotAuthorized(fileContext.Library.Name, fileContext.SubPath);
                    return fileContext.SendStatusAsync(Constants.Status403NotAuthorized);
                }

Update logger to expose authenticated and authorized logging templates, as well as Constants to include the two additional status codes.
StaticFileAuthorizationHandler : AuthorizationHandler can be defined to parse against the ClaimsPrincipal or even an injected DB context (however you want to setup your handler) for authorizing the static file request.
I further updated my customization to build this out based on entries my DB for ILibrary, thus I can define a LibraryServer with an endpoint of library, and it parses libraries and generates PhysicalFileProvider and serves the Path for the libraries exposed based on authentication and authorization.  Since this library treats each instance as a single path there's on need for that and would probably be best for this repo to instead utilize the authorization handler to treat the resource as the type of request being authorized, ie allow viewing the directory browser, or allow grabbing the static file.
Then you can just allow the developer to add in the auth requirements as desired:
            app.UseLibraryServer(new LibraryServerOptions
            {
                RequestPath = new PathString("/Library"),
                PathProvider = dbContextOrRepositoryOrServiceInheritingILibraryPathProvider,
                AuthenticationSchemes = new List<string> { CookieAuthenticationDefaults.AuthenticationScheme },
                AuthorizationRequirements = new List<IAuthorizationRequirement> { new LibraryAuthorizationRequirement() },
                LibraryFileOptions =
                {
                    ServeUnknownFileTypes = true
                }
            });

Obviously in that example I'm also providing a PathProvider for my db library entities that is out of scope of this post.  But you could pass AllowAnonymous = true, or pass in desired authentication schemes to target or against any defined, and any specific requirements.  Probably best to further expand it to allow just providing a policy name instead.
I could probably put together a pull request if you like this direction without the dynamic sub path options.  Biggest question would be is it worth while to provide a base requirement class or just let the developer define their own.

Any updates on this?

@blowdart What's your current thoughts on this?

Tentatively putting into the next milestone.

FYI, in the mean time.  You could make use of this to achieve auth on static files.
https://github.com/kyse/Kyse.AspNetCore.StaticLibrary

Here's a sample showing how to do AuthN and AuthZ for static files as a middleware on a pipeline branch:
https://github.com/aspnet/AuthSamples/blob/c7bb6607307072f6e098d0e4a2c9fa7e6d017916/samples/StaticFilesAuth/Startup.cs#L120-L134
This isn't ideal, we should still figure out how to integrate this as a first class citizen.
I also tried writing a sample using MVC's Authorize features, but MVC does not provide good handling for serving static files, directory browsing, default files, etc... See the discussion at https://github.com/aspnet/AuthSamples/pull/37.

@rynowak are StaticFiles endpoints still on your list?

Up, any updates related to this?

Only some updated guidance docs:
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-3.1#static-file-authorization

I made a custom endpoint pipeline with static file middleware. A few things to consider:

Make sure to reset endpoint to null
Pass an identical route to both RequestPath and Map

This has a tradeoff of matching the route twice (via endpoint and the middleware itself). You could manually set Path instead but it causes issues hard to diagnose.

authors: Tratcher alrz aspnet-hello jotatoledo kyse lumogox muratg

repo: aspnet/Home


text:
InvalidOperationException upon accessing AccountsController from default yeoman generator

The full error: "InvalidOperationException: Unable to resolve service for type 'WebApplication.Models.ApplicationDbContext' while attempting to activate 'Microsoft.AspNet.Identity.EntityFramework.UserStore`3[WebApplication.Models.ApplicationUser,Microsoft.AspNet.Identity.IdentityRole,WebApplication.Models.ApplicationDbContext]'."
I'm on OS X 10.10, trying to setup a default ASP.NET Web Application using Yeoman (generator-aspnet). Upon trying to access /Accounts/Login, or /Accounts/Register, the error above is displayed.
Does EF work on OS X? If not, what methods can I go about to persisting data. (While avoiding writing manual SQL statements everywhere...) My apologies if it is felt that this issue doesn't belong here. Wasn't sure where exactly it'd belong. It does however somewhat match Issue #359, but no one ever got to it.

So what I've been able to gather is, that EF does not work on OS X / unix based operating systems just yet. Something like this http://tattoocoder.com/building-vnext-web-api-using-mvc-6-mongodb-azure/ is recommended for the time being.

@divega can you take a look?

This issue is being closed because it has not been updated in 3 months.
We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.

authors: Eilon aspnet-hello russjr08


text:
Diabling async TestHost.Tests on Mono #507

As part of re-enabling hosting tests for CoreCLR in #422 on the CI.
Disabling tests that can potentially hang on Mono since the CI always run tests on Mono.

:shipit:

source: gharchive/pull-request

authors: JunTaoLuo Tratcher

repo: aspnet/Hosting


text:
Flaky test: Server_MultipleStopAsyncCallsCompleteOnSingleCancellation_FirstToken_Success

This test fails occasionally, seemingly specific to 2008.
Assert.True() Failure
Expected: True
Actual:   False
   at Microsoft.AspNetCore.Server.HttpSys.ServerTests.<Server_MultipleStopAsyncCallsCompleteOnSingleCancellation_FirstToken_Success>d__18.MoveNext() in C:\BuildAgent\work\33bdfc1cae7b2a38\modules\HttpSysServer\test\Microsoft.AspNetCore.Server.HttpSys.FunctionalTests\ServerTests.cs:line 498
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

Future instances of this failure will appear here.

This is still happening and has a roughly 9% failure rate on Win2008 Universe.

repo: aspnet/HttpSysServer


text:
dotnet all the things

Depends on aspnet/dnx#2015

:shipit:

Will this build failed with https://github.com/aspnet/dnx/pull/2015.

authors: bricelam natemcmaster troydai