title: ExecuteSqlRaw parametric query in .NET Core 3
body: <p>I'm trying to execute a parametric query in C#, the code is this:</p>
  
  <pre><code>string sql = @"INSERT INTO [dbo].[ShoppingListShop] " +
                                      "([PlaceId], " +
                                      "[Name], " +
                                      "[Address], " +
                                      "[Location], " +
                                      "[NorthEast], " +
                                      "[SouthWest], " +
                                      "[Date], " +
                                      "[LocationLat], " +
                                      "[LocationLng], " +
                                      "[NorthEastLat], " +
                                      "[NorthEastLng], " +
                                      "[SouthWestLat], " +
                                      "[SouthWestLng])" +
                "VALUES(" +
                                      "@placeId, " +
                                      "@name, " +
                                      "@address, " +
                                      "GEOGRAPHY::Point(@lat, @lng, 4326), " +
                                      "GEOGRAPHY::Point(@nelat, @nelng, 4326), " +
                                      "GEOGRAPHY::Point(@swlat, @swlng, 4326), " +
                                      "SYSDATETIMEOFFSET(), " +
                                      "@lat, " +
                                      "@lng, " +
                                      "@nelat, " +
                                      "@nelng, " +
                                      "@swlat, " +
                                      "@swlng);";
  
  SqlParameter placeIdPrm = new SqlParameter("@placeId", SqlDbType.NVarChar);
  SqlParameter namePrm = new SqlParameter("@name", SqlDbType.NVarChar);
  SqlParameter addressPrm = new SqlParameter("@address", SqlDbType.NVarChar);
  SqlParameter latPrm = new SqlParameter("@lat", SqlDbType.Decimal, 18);
  SqlParameter lngPrm = new SqlParameter("@lng", SqlDbType.Decimal, 18);
  SqlParameter neLatPrm = new SqlParameter("@nelat", SqlDbType.Decimal, 18);
  SqlParameter neLngPrm = new SqlParameter("@nelng", SqlDbType.Decimal, 18);
  SqlParameter swLatPrm = new SqlParameter("@swlat", SqlDbType.Decimal, 18);
  SqlParameter swLngPrm = new SqlParameter("@swlng", SqlDbType.Decimal, 18);
  
  placeIdPrm.Value = shop.PlaceId;
  namePrm.Value = shop.Name;
  addressPrm.Value = shop.Address;
  
  latPrm.Value = shop.LocationLat;
  lngPrm.Value = shop.LocationLng;
  
  neLatPrm.Value = shop.NorthEastLat;
  neLngPrm.Value = shop.NorthEastLng;
  
  swLatPrm.Value = shop.SouthWestLat;
  swLngPrm.Value = shop.SouthWestLng;
  
  SqlParameter[] parametri = new SqlParameter[9] { placeIdPrm, namePrm, addressPrm, latPrm, lngPrm, neLatPrm, neLngPrm, swLatPrm, swLngPrm };
  
  sqlServerDbContext.Database.ExecuteSqlRaw(sql, parametri);
  </code></pre>
  
  <p>For some reason I get this exception</p>
  
  <blockquote>
    <p>The SqlParameterCollection only accepts non-null SqlParameter type objects, not SqlParameter objects. </p>
  </blockquote>
  
  <p>What am I doing wrong?</p>