- Open PrimePenguinService.nswag in NSwagStudio and get fresh copy for Schema.
- Generate the file with new schema
- Use VSCode to Open the generated PrimePenguinService.cs file.
- Search & Replace
System.DateTimewithDateTime - Search & Replace
public System.Collections.Generic.IEnumerablewithpublic System.Collections.Generic.List - Search & Replace the following with empty character:
- System.Threading.Tasks.
- Newtonsoft.Json.
- System.Collections.Generic.
- Add the following using statements:
using System;using System.Threading.Tasks;using System.Collections.Generic;using Newtonsoft.Json;
- Search & Replace
Task<List<withTa11111sk<List<. - Search & Replace
ReadObjectResponseAsync<List<withRead11111ObjectResponseAsync<List<. - Select
Task<and pressCTRL + SHIFT + Lto select all occurences. AppendPrimePenguinResponse<and pressShift + >and close the last word with>.- Example:
Task<PagedResultDtoOfContractFileDto>will be replaced byTask<PrimePenguinResponse<PagedResultDtoOfContractFileDto>>.
- Example:
- Select
ReadObjectResponseAsync<and pressCTRL + SHIFT + Lto select all occurences. AppendPrimePenguinResponse<and pressShift + >and close the last word with>. - Select
Ta11111sk<and pressCTRL + SHIFT + Lto select all occurences. Replace withTask<PrimePenguinResponse<and pressShift + >twice and close the last word with>. - Select
Read11111ObjectResponseAsync<and pressCTRL + SHIFT + Lto select all occurences. Replace withReadObjectResponseAsync<PrimePenguinResponse<and pressShift + >twice and close the last word with>. - Search & Replace the following with empty character:
- , Required = Required.Default
- , Required = Required.DisallowNull
- Replace
Task<PrimePenguinResponse<ObjectResponseResult><T>> ReadObjectResponseAsync<PrimePenguinResponse<T>>withTask<ObjectResponseResult<T>> ReadObjectResponseAsync<T>. - Manually fix the
foreachloops that take list of objects as input.
if (customerTenantIds != null)
{
urlBuilder_.Append(System.Uri.EscapeDataString("CustomerTenantIds") + "=");
foreach (var item_ in customerTenantIds)
{
urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append(",");
}
urlBuilder_.Length--;
urlBuilder_.Append("&");
}Should look as
if (customerTenantIds != null)
{
foreach (var item_ in customerTenantIds)
{
urlBuilder_.Append(System.Uri.EscapeDataString("CustomerTenantIds") + "=")
.Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&');
}
urlBuilder_.Length--;
urlBuilder_.Append("&");
}