@@ -76,17 +76,17 @@ public OrderDb Create(OrderDb model)
7676 {
7777 if ( this . dataContext . Customers . FirstOrDefault ( c => c . CustomerId == model . CustomerId ) == null )
7878 {
79- throw new InvalidOperationException ( string . Format ( CultureInfo . InvariantCulture , StringTemplates . InvalidEntityMessage , nameof ( model . Customer ) , model . CustomerId ? . ToString ( ) ) ) ;
79+ throw new InvalidOperationException ( string . Format ( CultureInfo . InvariantCulture , StringTemplates . InvalidEntityMessage , nameof ( model . Customer ) , model . CustomerId ? . ToString ( CultureInfo . InvariantCulture ) ) ) ;
8080 }
8181
8282 if ( this . dataContext . Employees . FirstOrDefault ( e => e . EmployeeId == model . EmployeeId ) == null )
8383 {
84- throw new InvalidOperationException ( string . Format ( CultureInfo . InvariantCulture , StringTemplates . InvalidEntityMessage , nameof ( model . Employee ) , model . EmployeeId . ToString ( ) ) ) ;
84+ throw new InvalidOperationException ( string . Format ( CultureInfo . InvariantCulture , StringTemplates . InvalidEntityMessage , nameof ( model . Employee ) , model . EmployeeId ? . ToString ( CultureInfo . InvariantCulture ) ) ) ;
8585 }
8686
8787 if ( this . dataContext . Shippers . FirstOrDefault ( s => s . ShipperId == model . ShipperId ) == null )
8888 {
89- throw new InvalidOperationException ( string . Format ( CultureInfo . InvariantCulture , StringTemplates . InvalidEntityMessage , nameof ( model . Shipper ) , model . ShipperId . ToString ( ) ) ) ;
89+ throw new InvalidOperationException ( string . Format ( CultureInfo . InvariantCulture , StringTemplates . InvalidEntityMessage , nameof ( model . Shipper ) , model . ShipperId ? . ToString ( CultureInfo . InvariantCulture ) ) ) ;
9090 }
9191
9292 var id = IdGenerator . CreateDigitsId ( ) ;
@@ -123,12 +123,12 @@ public OrderDb Create(OrderDb model)
123123
124124 if ( this . dataContext . Employees . FirstOrDefault ( e => e . EmployeeId == model . EmployeeId ) == null )
125125 {
126- throw new InvalidOperationException ( string . Format ( CultureInfo . InvariantCulture , StringTemplates . InvalidEntityMessage , nameof ( model . Employee ) , model . EmployeeId . ToString ( ) ) ) ;
126+ throw new InvalidOperationException ( string . Format ( CultureInfo . InvariantCulture , StringTemplates . InvalidEntityMessage , nameof ( model . Employee ) , model . EmployeeId ? . ToString ( CultureInfo . InvariantCulture ) ) ) ;
127127 }
128128
129129 if ( this . dataContext . Shippers . FirstOrDefault ( s => s . ShipperId == model . ShipperId ) == null )
130130 {
131- throw new InvalidOperationException ( string . Format ( CultureInfo . InvariantCulture , StringTemplates . InvalidEntityMessage , nameof ( model . Shipper ) , model . ShipperId . ToString ( ) ) ) ;
131+ throw new InvalidOperationException ( string . Format ( CultureInfo . InvariantCulture , StringTemplates . InvalidEntityMessage , nameof ( model . Shipper ) , model . ShipperId ? . ToString ( CultureInfo . InvariantCulture ) ) ) ;
132132 }
133133
134134 var orderEntity = this . dataContext . Orders
0 commit comments