This commit is contained in:
Wolfgang Hottgenroth 2021-12-02 17:28:29 +01:00
parent 959b36760a
commit c6fb7b498f
Signed by: wn
GPG Key ID: E49AF3B9EF6DD469
2 changed files with 35 additions and 3 deletions

View File

@ -65,22 +65,28 @@ namespace de.hottis.genericdatabaseapiservice.Services {
var dma = (DataMemberAttribute)attributes[0];
int ordinal = reader.GetOrdinal(dma.Name);
Console.WriteLine("Output DataMember name: {0} {1} {2} ", dma.Name, dma.TypeId, ordinal);
if (reader.IsDBNull(ordinal)) {
if (await reader.IsDBNullAsync(ordinal)) {
propertyInfo.SetValue(item, null);
Console.WriteLine("Output Value: null");
} else if (propertyInfo.PropertyType == typeof(System.String)) {
var value = reader.GetString(ordinal);
propertyInfo.SetValue(item, value);
Console.WriteLine("Output Value:{0}", value);
} else if (propertyInfo.PropertyType == typeof(System.Int32)) {
} else if (propertyInfo.PropertyType == typeof(System.Int32) ||
propertyInfo.PropertyType == typeof(System.Nullable<System.Int32>)) {
var value = reader.GetInt32(ordinal);
propertyInfo.SetValue(item, value);
Console.WriteLine("Output Value:{0}", (System.Int32)value);
} else if (propertyInfo.PropertyType == typeof(System.DateTime)) {
var value = reader.GetDateTime(ordinal);
propertyInfo.SetValue(item, value);
Console.WriteLine("Output Value:{0}", value);
} else {
throw new UnsupportedDataTypeException();
}
}
itemList.Add(item);
Console.WriteLine("Item is {0}", item);
}
}
}

View File

@ -343,25 +343,32 @@ components:
properties:
productionOrderNumber:
type: string
nullable: true
cgNumber:
type: string
nullable: true
articleCode:
type: string
nullable: true
numOfParts:
type: integer
nullable: true
ix:
type: string
nullable: true
referenceDocument:
type: string
nullable: true
baseData:
description: Selecting columns of the stammdaten table from pdb_el
type: object
properties:
articleNumber:
type: string
nullable: true
category:
type: string
nullable: true
description:
type: string
productionItem:
@ -369,36 +376,52 @@ components:
properties:
serialNumber:
type: integer
nullable: true
productionOrder:
type: string
nullable: true
eRevPlanned:
type: string
nullable: true
eRevDone:
type: string
nullable: true
resultFirstStartup:
type: string
nullable: true
resultCalibration:
type: string
nullable: true
deliveryDate:
type: datetime
type: dateTime
nullable: true
snlp1:
type: integer
nullable: true
snlp2:
type: integer
nullable: true
snlp3:
type: integer
nullable: true
snlp4:
type: integer
nullable: true
snlp5:
type: integer
nullable: true
snlp6:
type: integer
nullable: true
snlp7:
type: integer
nullable: true
snlp8:
type: integer
nullable: true
snlp9:
type: integer
nullable: true
snlp10:
type: integer
productionOrderItem:
@ -406,7 +429,10 @@ components:
properties:
productionOrder:
type: string
nullable: true
serialNumber:
type: integer
nullable: true
batchIndex:
type: integer
nullable: true