using System.Collections.Generic;
public static void Main()
var properties = type.GetProperties().ToList();
var props = new List<string>();
foreach (var item in properties)
var t = item.PropertyType.Name;
var test = Nullable.GetUnderlyingType(item.PropertyType);
var nullSymbol = nullable ? "NULL" : "NOT NULL";
props.Add($"{name} {dbType} {nullSymbol}");
Console.WriteLine($"CREATE TABLE {type.Name} (");
foreach (var item in props)
var index = props.IndexOf(item);
if((props.Count() - 1) == index){
Console.WriteLine($" {item}");
Console.WriteLine($" {item},");
public static string? Types(string type)
string? returnValue = null;
returnValue = "DECIMAL(10,20)";
returnValue = "NVARCHAR(255)";
returnValue = "UNIQUEIDENTIFIER";
public int Id { get; set; }
public long? id2 { get; set; }
public Guid Test { get; set; }