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]; var dma = (DataMemberAttribute)attributes[0];
int ordinal = reader.GetOrdinal(dma.Name); int ordinal = reader.GetOrdinal(dma.Name);
Console.WriteLine("Output DataMember name: {0} {1} {2} ", dma.Name, dma.TypeId, ordinal); 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); propertyInfo.SetValue(item, null);
Console.WriteLine("Output Value: null"); Console.WriteLine("Output Value: null");
} else if (propertyInfo.PropertyType == typeof(System.String)) { } else if (propertyInfo.PropertyType == typeof(System.String)) {
var value = reader.GetString(ordinal); var value = reader.GetString(ordinal);
propertyInfo.SetValue(item, value); propertyInfo.SetValue(item, value);
Console.WriteLine("Output Value:{0}", 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); var value = reader.GetInt32(ordinal);
propertyInfo.SetValue(item, value); 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); Console.WriteLine("Output Value:{0}", value);
} else { } else {
throw new UnsupportedDataTypeException(); throw new UnsupportedDataTypeException();
} }
} }
itemList.Add(item); itemList.Add(item);
Console.WriteLine("Item is {0}", item);
} }
} }
} }

View File

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