File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/Onbox.TypeSharp/Services Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ public string ConvertModel(Type type)
199199 }
200200 }
201201 }
202-
202+
203203 if ( ! typeUnitSuccess )
204204 {
205205 var nullableType = "" ;
@@ -220,6 +220,11 @@ public string ConvertModel(Type type)
220220 propType = "unknown" ;
221221 }
222222
223+ if ( ContainsPartialAttr ( prop ) )
224+ {
225+ propType = $ "Partial<{ propType } >";
226+ }
227+
223228 classBodyBuilder . AppendLine ( $ " { propName } { optionalType } : { propType } { nullableType } ;") ;
224229 }
225230 }
@@ -249,6 +254,12 @@ private bool ContainsUnknownObjectAttr(PropertyInfo prop)
249254 return prop . CustomAttributes . FirstOrDefault ( a => a . AttributeType . Name . Equals ( "UnknownObjectAttribute" ) ) != null ;
250255 }
251256
257+ private bool ContainsPartialAttr ( PropertyInfo prop )
258+ {
259+ if ( prop == null ) return false ;
260+ return prop . CustomAttributes . FirstOrDefault ( a => a . AttributeType . Name . StartsWith ( "Partial" ) ) != null ;
261+ }
262+
252263 private void HandlePropertyWritting ( Type parentType , Type propType )
253264 {
254265 if ( this . propertyUtils . ShouldImport ( propType ) && propType != parentType && ! this . typeCache . Contains ( propType ) && propType . Name != "List`1" )
You can’t perform that action at this time.
0 commit comments