Question: Following Current Datamodell

```
User
  User ID

Video
   VideoID
   LikedBy (Subcol) 
       User ID
       User ID
       User ID

```

Now if a User visits a video I wanna show if he Liked the Video already or not (similar to youtubes button color if you liked already). 

My current approach is querieing for a Document with the Key of the signed In UserID and if I find one it means the user liked the video. The problem is I have this for Artists that you can subscribe too similar to channels on youtube.

This alone created about 3x the initial Reads I have on Page Load.
I would like to hear if there is any more efficient way to query for such a thing or structure the data.

Be aware that if you suggest me to store all liked Shows in the User or Show Document that this is not scalable due to the 1MB Limit.

Answer: 
From a lot of experimenting and research, it seems it is currently not possible to move the Startup class, due to a bug with it not respecting the `ContentRoot` path set using the `UseContentRoot` method. This bug is tracked by [issue #11921](https://github.com/aspnet/AspNetCore/issues/11921) on AspNetCore GitHub.

A very hacky workaround if you need to be able to inject dependencies from a test project, is to create a static class `Dependencies` in your main project, with a static `Action<IStartupConfiguration> RegisterDependencies` field, which you then call in the Startup class:

```
public void ConfigureServices(IServiceCollection services)
{
    services.AddRazorPages();
    services.AddServerSideBlazor();
    Dependencies.RegisterDependencies(services);
}

```

Then, in `Program.cs` set `RegisterDepenedencies` to register the dependencies you need:

```
public static void Main(string[] args)
{
    Dependencies.RegisterDependencies = s =>
    {
        s.AddSingleton<IWeatherForecastService, WeatherForecastService>();
    };

    CreateHostBuilder(args).Build().Run();
}

```

You can now change this method in the test project to configure different dependencies when running integration tests. In your test project:

```
Dependencies.RegisterDependencies = s =>
{
    s.AddSingleton<IWeatherForecastService, MockWeatherForecastService>();
};

```

**This is very hacky, hopefully the `ContentRoot` issue is fixed, then changing the content root to the main project should be used instead**
For me the following worked:

```cs
Program.CreateHostBuilder(new string[0]).Build().RunAsync();

```

while I had to create a `.sln` which binds the project with the test folder like shown in [this guide](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-nunit)