Skip to content

Commit 99ab691

Browse files
author
Caitlin Bales (MSFT)
committed
Add custom import statements
Fixes manual addition of custom import statement for: - UploadSession
1 parent e223130 commit 99ab691

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Templates/Android/BaseModel.template.tt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,4 +808,12 @@ public {1} {2}{3}{4} {{";
808808

809809
return property != null ? property.GetValue(customMethods).ToString() : string.Empty;
810810
}
811+
812+
public string AddCustomImport(string className) {
813+
CustomImports customImports = new CustomImports();
814+
var type = customImports.GetType();
815+
var property = type.GetFields().Where(x => x.Name == className).FirstOrDefault();
816+
817+
return property != null ? property.GetValue(customImports).ToString() : string.Empty;
818+
}
811819
#>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Microsoft.Graph.ODataTemplateWriter.CodeHelpers.Android
8+
{
9+
public class CustomImports
10+
{
11+
public const string UploadSession = "import com.microsoft.graph.concurrency.ChunkedUploadProvider;\r\n";
12+
}
13+
}

0 commit comments

Comments
 (0)