Skip to content

Commit

Permalink
add support type
Browse files Browse the repository at this point in the history
  • Loading branch information
neozhu committed Sep 12, 2024
1 parent 0a4f28b commit 06e8515
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Models/IntellisenseParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
19 changes: 19 additions & 0 deletions src/Templatemap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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?":
Expand Down

0 comments on commit 06e8515

Please sign in to comment.