public void CreateMethod(CodeWriter cw, ServiceInfo info, OperationInfo operationInfo, Dossier dossier) { cw.LineStart(); cw.Write($@"{operationInfo.Name}("); bool first = true; foreach (IParameterInfo parameterInfo in operationInfo.Parameters) { if (first) { first = false; } else { cw.WriteLine(", "); cw.LineStart(); } ITssParameterMold mold = ParameterMolds.Create(parameterInfo); if (mold == null) { dossier.AddError("Mold not found.", parameterInfo); } else { mold.DoCreateParameter(parameterInfo, cw); } } cw.Write(")"); string typeName = TsUtility.GetTypeName(operationInfo.ResponseEntityInfo?.Name, "models"); if (!string.IsNullOrEmpty(typeName)) { cw.Write(": "); cw.Write(typeName); } cw.WriteLine(); }
protected override string GetTypeName(ParentAttributeInfo field) { return(TsUtility.GetTypeName(field.ParentEntityInfo?.Name, "")); }
protected virtual string GetTypeName(T field) { return(TsUtility.GetTypeName("", "")); }
protected override void DoWriteAttributes(ChildAttributeInfo field, CodeWriter cw) { cw.WriteLine($@"@JsonProperty(""{field.JsonName}"", [{TsUtility.GetTypeName(field.ChildEntityInfo?.Name, "")}])"); }
protected override string GetTypeName(ChildAttributeInfo field) { return(TsUtility.GetTypeName(field.ChildEntityInfo?.Name, "") + "[]"); }
protected override string GetTypeName(EntityParameterInfo field) { return(TsUtility.GetTypeName(field.EntityInfo?.Name, "models")); }
protected override string GetTypeName(MultipleParameterInfo field) { return(TsUtility.GetTypeName(field.ParentServiceInfo?.Name, "models")); }