/// <summary> /// Возвращает значение дефалта /// </summary> /// <param name="def">Дефалт</param> /// <returns>Значение дефалта</returns> public static string GetDefaultValue(Default def) { string result = string.Empty; ValueDefault vd = def as ValueDefault; if (vd != null) { result = vd.Value; } else { StandartDefault sd = def as StandartDefault; if (sd != null) { switch (sd.DefaultType) { case StandartDefaultType.date: result = "getdate()"; break; case StandartDefaultType.guid: result = "newid()"; break; default: result = string.Empty; break; } } } return result; }
/// <summary> /// Возвращает значение дефалта /// </summary> /// <param name="def">Дефалт</param> /// <returns>Значение дефалта</returns> public static string GetDefaultValue(Default def) { string result = string.Empty; ValueDefault vd = def as ValueDefault; if (vd != null) { result = string.Format("''{0}''", vd.Value); } else { StandartDefault sd = def as StandartDefault; if (sd != null) { switch (sd.DefaultType) { case StandartDefaultType.date: result = "sysdate"; break; case StandartDefaultType.guid: result = "sys_guid()"; break; default: result = string.Empty; break; } } } return result; }