File tree Expand file tree Collapse file tree 1 file changed +11
-18
lines changed
src/GraphODataTemplateWriter/CodeHelpers/Java Expand file tree Collapse file tree 1 file changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -754,25 +754,18 @@ public static string CreatePackageDefForEnum(this CustomT4Host host)
754
754
}
755
755
public static string GetPackagePrefix ( this OdcmObject obj )
756
756
{
757
- if ( obj is OdcmEnum )
757
+ switch ( obj )
758
758
{
759
- return "models.generated" ;
760
- }
761
- else if ( obj is OdcmType )
762
- {
763
- return GetPrefixForModels ( ) ;
764
- }
765
- else if ( obj is OdcmParameter )
766
- {
767
- return GetPackagePrefix ( ( obj as OdcmParameter ) . Type ) ;
768
- }
769
- else if ( obj is OdcmProperty )
770
- {
771
- return GetPackagePrefix ( ( obj as OdcmProperty ) . Type ) ;
772
- }
773
- else
774
- {
775
- throw new ArgumentException ( "obj" ) ;
759
+ case OdcmEnum e :
760
+ return "" ;
761
+ case OdcmType t :
762
+ return GetPrefixForModels ( ) ;
763
+ case OdcmParameter p :
764
+ return GetPackagePrefix ( p . Type ) ;
765
+ case OdcmProperty p :
766
+ return GetPackagePrefix ( p . Type ) ;
767
+ default :
768
+ throw new ArgumentException ( nameof ( obj ) ) ;
776
769
}
777
770
}
778
771
public static string CreatePackageDefinition ( this CustomT4Host host )
You can’t perform that action at this time.
0 commit comments