-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Npgsql: Use
EnableDynamicJson
to unlock better container type mappings
Vanilla Npgsql provides good enough support to handle CrateDB's ARRAY and OBJECT types better than just plain strings. This patch demonstrates type mappings to native .NET `List` and `Dictionary` types, as well as type mappings to custom .NET POCO types.
- Loading branch information
Showing
4 changed files
with
141 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace demo; | ||
|
||
public class BasicPoco | ||
{ | ||
|
||
public string? name { get; set; } | ||
public int? age { get; set; } | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
var other = (BasicPoco) obj; | ||
return name == other.name && age == other.age; | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return base.GetHashCode(); | ||
} | ||
|
||
public override string ToString() => "Name: " + name + " Age: " + age; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters