From 06e8515f0fb37622a3bb398f147d3198911a1b38 Mon Sep 17 00:00:00 2001 From: "hualin.zhu" Date: Thu, 12 Sep 2024 21:31:20 +0800 Subject: [PATCH] add support type --- src/Models/IntellisenseParser.cs | 8 ++++++++ src/Templatemap.cs | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/Models/IntellisenseParser.cs b/src/Models/IntellisenseParser.cs index 472355d..f9e7bb3 100644 --- a/src/Models/IntellisenseParser.cs +++ b/src/Models/IntellisenseParser.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Numerics; using System.Runtime.InteropServices; using System.Text.RegularExpressions; using System.Xml.Linq; @@ -401,6 +402,13 @@ private static CodeTypeRef TryToGuessGenericArgument(CodeClass rootElement, Code { "float", typeof( float ) }, { "double", typeof( double ) }, { "decimal", typeof( decimal ) }, + { "Guid", typeof( Guid ) }, + { "DateTime", typeof( DateTime ) }, + { "DateTimeOffset", typeof( DateTimeOffset ) }, + { "bool", typeof( bool ) }, + { "BigInteger", typeof( BigInteger ) }, + { "char", typeof( char ) } + }; private static string TryToGuessFullName(string typeName) diff --git a/src/Templatemap.cs b/src/Templatemap.cs index 9ef3a11..7e79ddb 100644 --- a/src/Templatemap.cs +++ b/src/Templatemap.cs @@ -238,6 +238,25 @@ private static string createDtoFieldDefinition(IntellisenseObject classObject) case "System.DateTime": output.Append($" public DateTime {property.Name} {{get;set;}} \r\n"); break; + case "System.TimeSpan?": + output.Append($" public TimeSpan? {property.Name} {{get;set;}} \r\n"); + break; + case "System.TimeSpan": + output.Append($" public TimeSpan {property.Name} {{get;set;}} \r\n"); + break; + case "System.DateTimeOffset": + output.Append($" public DateTimeOffset {property.Name} {{get;set;}} \r\n"); + break; + case "System.DateTimeOffset?": + output.Append($" public DateTimeOffset? {property.Name} {{get;set;}} \r\n"); + break; + case "System.Guid": + output.Append($" public Guid {property.Name} {{get;set;}} \r\n"); + break; + case "char?": + case "char": + case "float?": + case "float": case "decimal?": case "decimal": case "int?":