Skip to content

Commit

Permalink
Remove Mono check for sql types to avoid netcore on linux issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hanes committed Nov 12, 2018
1 parent 31564e3 commit 2d2f1fa
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/SqlClient.DesignTime/SqlClientExtensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,7 @@ type SqlConnection with
if not <| dataTypeMappings.ContainsKey this.ConnectionString
then
assert (this.State = ConnectionState.Open)

let runningOnMono = try System.Type.GetType("Mono.Runtime") <> null with _ -> false


let sqlEngineTypes = [|
use cmd = new SqlCommand("
SELECT t.name, t.system_type_id, t.user_type_id, t.is_table_type, s.name as schema_name, t.is_user_defined
Expand All @@ -452,10 +450,8 @@ type SqlConnection with
", this)
use reader = cmd.ExecuteReader()
while reader.Read() do
// #105 - disable assembly types when running on mono, because GetSchema() doesn't return these types on mono.
let systemTypeId = unbox<byte> reader.["system_type_id"]
if not runningOnMono || systemTypeId <> 240uy then
yield
yield
string reader.["name"],
int systemTypeId,
unbox<int> reader.["user_type_id"],
Expand Down

0 comments on commit 2d2f1fa

Please sign in to comment.