title: asp.net core api healthcheck
body: <p>I'm adding a few healthchecks to my netcore website. One of them is checking whether the connection string is pointing to a database that has the support for in memory tables activated (essentially if the filegroup was created with the CONTAINS MEMORY_OPTIMIZED_DATA flag).</p>
  <p>The healthcheck is det to use this query:</p>
  <pre><code>IF((SELECT COUNT(1) FROM sys.filegroups FG
  JOIN sys.database_files DF
  ON FG.data_space_id = DF.data_space_id
  JOIN sys.master_files MF
  ON DF.file_id = MF.file_id
  JOIN sys.databases DB
  ON DB.database_id = MF.database_id
  where FG.type = 'FX'
  and DB.name ='MyDB')&gt;0)
  BEGIN
  SELECT 1
  END
  ELSE
  BEGIN
  RAISERROR ('Memory file group not set',  
  18, -- Severity,  
  -1); -- State);
  END
  </code></pre>
  <p>And registered via:</p>
  <pre><code>.AddSqlServer(connectionString: connString,
      healthQuery: myHealthQuery, name: HealthCheckNames.InMemoryState)
  </code></pre>
  <p>The query does return 1, without any error. I've set up a profiler to run through it, and no error is thrown (and I can see the Select 1 being returned).</p>
  <p>Still, that healthcheck returns unhealthy.</p>
  <p>Any idea why?</p>