Example #1
0
 /// <summary>
 /// Создает типизированный врайтер
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static SqlCommandWriter Create(SqlObject obj)
 {
     if (obj is SqlFunction)
     {
         return(new SqlFunctionWriter(obj as SqlFunction));
     }
     if (obj is SqlView)
     {
         return(new SqlFunctionWriter(obj as SqlFunction));
     }
     if (obj is SqlTrigger)
     {
         return(new SqlFunctionWriter(obj as SqlFunction));
     }
     throw new NotSupportedException("not supported type " + obj.GetType().FullName);
 }
 public UnknownSqlObjectException(SqlObject sqlObject, Exception innerException = null)
     : base(
         message: $"Unknown {nameof(SqlObject)}: {sqlObject?.GetType()?.ToString() ?? "<NULL>"}",
         innerException: innerException)
 {
 }