private static Type GetDbType(PositionChangeTypes type) { switch (type) { case PositionChangeTypes.State: case PositionChangeTypes.Currency: return(typeof(string)); default: return(typeof(decimal)); } }
private static void ApplyCellStyle(ExcelWorker worker, PositionChangeTypes type, int column) { switch (type) { case PositionChangeTypes.Currency: case PositionChangeTypes.State: worker.SetStyle(column, typeof(string)); break; default: worker.SetStyle(column, typeof(decimal)); break; } }
private static Type GetDbType(PositionChangeTypes field) { var type = field.ToType(); if (type == null) { return(null); } if (type.IsEnum) { type = type.GetEnumUnderlyingType(); } return(type.IsClass ? type : typeof(Nullable <>).Make(type)); }
/// <summary> /// Is the specified <see cref="PositionChangeTypes"/> was marked by <see cref="ObsoleteAttribute"/>. /// </summary> /// <param name="type"><see cref="PositionChangeTypes"/> value.</param> /// <returns><see langword="true" />, if obsolete, otherwise, not obsolete.</returns> public static bool IsObsolete(this PositionChangeTypes type) => type.GetAttributeOfType <ObsoleteAttribute>() != null;
private static string GetChangesField(PositionChangeTypes type) { return($"{nameof(PositionChangeMessage.Changes)}[{type}]"); }