mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-10-26 18:41:18 +00:00
Fix the null check for schema should occur before accessing schema.PrimaryKey
This commit is contained in:
parent
82df8c5605
commit
dcf966b2c5
|
|
@ -36,11 +36,11 @@ namespace WelsonJS.Esent
|
||||||
{
|
{
|
||||||
_logger = logger ?? new TraceLogger();
|
_logger = logger ?? new TraceLogger();
|
||||||
|
|
||||||
_primaryKey = schema.PrimaryKey;
|
|
||||||
|
|
||||||
if (schema == null)
|
if (schema == null)
|
||||||
throw new ArgumentNullException(nameof(schema));
|
throw new ArgumentNullException(nameof(schema));
|
||||||
|
|
||||||
|
_primaryKey = schema.PrimaryKey;
|
||||||
|
|
||||||
if (_primaryKey == null)
|
if (_primaryKey == null)
|
||||||
throw new ArgumentNullException();
|
throw new ArgumentNullException();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ For more details, refer to the [WelsonJS Documentation](https://catswords-oss.rd
|
||||||
```csharp
|
```csharp
|
||||||
using WelsonJS.Esent;
|
using WelsonJS.Esent;
|
||||||
|
|
||||||
// connect the database to manage an instances
|
// connect the database to manage instances
|
||||||
Schema schema = new Schema("Instances", new List<Column>
|
Schema schema = new Schema("Instances", new List<Column>
|
||||||
{
|
{
|
||||||
new Column("InstanceId", typeof(string), 255),
|
new Column("InstanceId", typeof(string), 255),
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ For more details, refer to the [WelsonJS Documentation](https://catswords-oss.rd
|
||||||
```csharp
|
```csharp
|
||||||
using WelsonJS.Esent;
|
using WelsonJS.Esent;
|
||||||
|
|
||||||
// connect the database to manage an instances
|
// connect the database to manage instances
|
||||||
Schema schema = new Schema("Instances", new List<Column>
|
Schema schema = new Schema("Instances", new List<Column>
|
||||||
{
|
{
|
||||||
new Column("InstanceId", typeof(string), 255),
|
new Column("InstanceId", typeof(string), 255),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user