public CSConverter() { //req: string //req: string, list //req: numeric //res: numeric //res: string //req: numeric, list //res: timestamp //res: list of integers //res: boolean //res: associative array //res: float //res: list of strings //res: list of timestamps //req: timestamp / date //res: список словарей WGTypeToCSType.Add("string", "string"); WGTypeToCSType.Add("string, list", "string[]"); WGTypeToCSType.Add("numeric", "Int64?"); WGTypeToCSType.Add("numeric, list", "Int64[]"); WGTypeToCSType.Add("timestamp", "int?"); WGTypeToCSType.Add("list of integers", "int[]"); WGTypeToCSType.Add("boolean", "bool"); WGTypeToCSType.Add("associative array", "Dictionary<string,string>"); WGTypeToCSType.Add("float", "double"); WGTypeToCSType.Add("list of strings", "string[]"); WGTypeToCSType.Add("list of timestamps", "int[]"); WGTypeToCSType.Add("timestamp/date", "int?"); WGTypeToCSType.Add("список словарей", "Dictionary<string,string>"); }
private string GetTypeString(string fieldType) { if (!WGTypeToCSType.ContainsKey(fieldType)) { throw new ArgumentOutOfRangeException("Неизвестный тип данных: " + fieldType); } return(WGTypeToCSType[fieldType]); }