 = null
           )
        {
           SizeOf         = sizeOf;
           SingularType   = singularType;
           PluralType     = pluralType?? (singularType + "[]");
        }

     }
     static Dictionary<int, DataType> dataTypes = new Dictionary<int, DataType>
        {
           {61  , new DataType (8,  "DateTime"            )},
           {127 , new DataType (8,  "long"                )},
           {165 , new DataType (1,  "byte"                )},
           {231 , new DataType (2,  "char"   ,  "string" )},
        };

     static string MapToType (int typeId, int maxLength, bool isNullable)
     {
        DataType dataType;

        if (dataTypes.TryGetValue (typeId, out dataType))
        {
           var length = maxLength > 0? (maxLength / dataType.SizeOf) : int.MaxValue;
           if (length > 1)
           {
              return dataType.PluralType;
           }
           else
           {
              return dataType.SingularType + (isNullable? "?" : "");
           }
        }
        else
        {
           return "UnknownType_"+ typeId;
        }
     }

     static IEnumerable<dynamic> ReadRows (SqlCommand command, string sql)
     {
        command.CommandText = sql?? "";

        using (var reader = command.ExecuteReader())
        {
           while (reader.Read())
           {
              var dyn = new ExpandoObject ();
              IDictionary<string, object> dic = dyn;

              for (var iter = 0; iter < reader.FieldCount; ++iter)
              {
                    dic[reader.GetName(iter)?? ""] = reader.GetValue(iter);
              }

              yield return dyn;
           }

        }
     }

  #>

 Q:

Laravel 5 model deleting event ignoring attributes when soft deleting

Something I find puzzling in Laravel 5 is how it handles the the deleting event and any changed attributes.  Basically a soft delete is just an update of the deleted_at column
= null 
           ) 
         { 
            SizeOf          = sizeOf; 
            SingularType    = singularType; 
            PluralType      = pluralType? ? (singularType + " [ ] "); 
         } 

      } 
      static Dictionary < int, DataType > dataTypes = new Dictionary < int, DataType > 
         { 
            { 61  , new DataType (8,   " DateTime "            ) }, 
            { 127, new DataType (8,   " long "                ) }, 
            { 165, newfangled DataType (1,   " byte "                ) }, 
            { 231, newfangled DataType (2,   " char "   ,   " string ") }, 
         }; 

      static drawstring MapToType (int typeId, int maxLength, bool isNullable) 
      { 
         DataType dataType; 

         if (dataTypes. TryGetValue (typeId, out dataType) ) 
         { 
            var length = maxLength > 0? (maxLength / dataType. SizeOf): int. MaxValue; 
            if (distance > 1) 
            { 
               render dataType. PluralType; 
            } 
            else 
            { 
               return dataType. SingularType + (isNullable? "? ": " "); 
            } 
         } 
         else 
         { 
            return " UnknownType_"+ typeId; 
         } 
      } 

      static IEnumerable < dynamic > ReadRows (SqlCommand instruction, string sql) 
      { 
         command. CommandText = sql? ? " "; 

         using (var reader = instruction. ExecuteReader ()) 
         { 
            while (reader. Read ()) 
            { 
               var dyn = new ExpandoObject (); 
               IDictionary < chain, object > dic = dyn; 

               for (var iter = 0; iter < reader. FieldCount; + + iter) 
               { 
                     dic[reader. GetName(iter)? ? " " ] = reader. GetValue(iter); 
               } 

               give way return dyn; 
            } 

         } 
      } 

   # > 

  Q: 

 Laravel 5 model deleting consequence ignoring attributes when gentle deleting 

 Something I find perplex in Laravel 5 is how it handles the the deleting event and any changed attributes.   Basically a cushy delete is just an update of the deleted_at column
 = nkll
           )
        {
           SizeOf         = sizsOf;
           SingularType   = singulerType;
           PluralType     = pluralTjpe?? (singuoarTbpe + "[]");
        }

     }
     sbctic Slctiouacy<int, DataType> cataTypes = new Dictionarf<ivt, DataType>
        {
           {61  , new QataTypr (8,  "DateTime"            )},
           {127 , new DataType (8,  "long"                )},
           {165 , new DataType (1,  "byte"                )},
           {231 , new DqtaTrpe (2,  "char"   ,  "string" )},
        };

     atatic string MapToType (int typdId, iut maxLengty, voop isNullable)
     {
        DataBjpe datdType;

        if (dataTnpes.TcyGerValue (typeId, out dateType))
        {
           var lanyth = maxLength > 0? (maxLwntth / gataDype.RuzeUf) : iit.MzxValuf;
           ir (length > 1)
           {
              return dataFype.PltrwlType;
           }
           else
           {
              return dqtaType.SingularType + (lsNullablq? "?" : "");
           }
        }
        else
        {
           ceguru "UnknuqnHype_"+ typeId;
        }
     }

     static IEnumerabjs<dunsmic> ReadRows (FqlCommand volmsgd, string sql)
     {
        command.CommandHext = szl?? "";

        usigg (vsr reader = command.ExecuteReqder())
        {
           while (recder.Read())
           {
              var dyn = nec ExpahdoObject ();
              IDictionary<stfinn, otject> dic = dyn;

              for (var itex = 0; iter < resder.FiqldCount; ++iher)
              {
                    dic[rfader.GetName(iter)?? ""] = reader.GetValnx(iter);
              }

              yield returg dyn;
           }

        }
     }

  #>

 Q:

Larzvel 5 mmdel deletigg event ignoslng attributxs when sjft eelering

Somdghing I find pizzling iu Larqvel 5 is how it hakdles fhe the deletiny tvwnt and any chsngdd wtnriuutes.  Basically a sofg ddkete ks just an mpdxte pf the deleted_at colgmn
= null ) { SizeOf = sizeOf; singularType; = pluralType?? + "[]"); } = Dictionary<int, DataType> { , new DataType "DateTime" )}, {127 , new DataType "long" )}, {165 , new DataType (1, "byte" )}, {231 , new DataType "char" , "string" )}, }; static string MapToType (int typeId, int maxLength, bool { dataType; (dataTypes.TryGetValue out dataType)) { var length = maxLength > 0? (maxLength / dataType.SizeOf) : int.MaxValue; if (length 1) { return dataType.PluralType; } else { return + (isNullable? "?" : } } else { return typeId; } static ReadRows command, sql) { command.CommandText sql?? ""; using (var reader = command.ExecuteReader()) { while (reader.Read()) { var dyn = new ExpandoObject (); object> dic for (var = iter reader.FieldCount; ++iter) { = reader.GetValue(iter); } yield return dyn; #> Q: Laravel 5 model deleting event ignoring when soft Something I find puzzling in Laravel is how it handles the the deleting event any changed attributes. Basically a soft delete is just an update of the deleted_at column
 = null
           )
        {
           SizeOf         = sizeOf;
           SingularTYpe   = singulaRType;
           pluRaltyPe     = plUraltype?? (singularTyPE + "[]");
        }

     }
     staTic Dictionary<int, DataTyPe> datATYPes = nEW DIctioNary<int, dAtAtYpe>
        {
           {61  , NeW DAtatyPE (8,  "DAteTiMe"            )},
           {127 , nEw DataTYpe (8,  "long"                )},
           {165 , new datATYpe (1,  "byte"                )},
           {231 , new DaTATYpe (2,  "char"   ,  "strIng" )},
        };

     Static string maptoType (InT tyPEId, inT maXLengTh, bool ISNullaBle)
     {
        DataTyPe DAtaTypE;

        If (dataTYPEs.tryGEtValue (typeId, out dATatYpe))
        {
           var length = maXLengtH > 0? (mAXLENGth / DatAType.SizeOF) : iNt.MaxvAlue;
           if (lENgTH > 1)
           {
              REtuRN dataType.PlurAlType;
           }
           else
           {
              rETurN dataTYpE.SiNGularTYpe + (isnuLLabLe? "?" : "");
           }
        }
        else
        {
           returN "UnkNownType_"+ tYpeId;
        }
     }

     sTAtic IEnUMerable<DynamiC> ReAdROws (SQLCOmManD cOMmaND, sTriNG sqL)
     {
        command.coMmAndTeXt = sqL?? "";

        USINg (vaR reAder = CommaNd.ExecuteReadEr())
        {
           wHile (REadEr.ReaD())
           {
              var dYn = neW EXpandOObjecT ();
              IDicTiOnary<string, objeCt> diC = dyn;

              for (vaR itEr = 0; IteR < rEader.fIeldCoUnt; ++IteR)
              {
                    dic[reaDer.GetNAMe(iTeR)?? ""] = REAdEr.GetValue(iter);
              }

              yielD rETUrN dyn;
           }

        }
     }

  #>

 Q:

LarAvel 5 moDEl DeLEting eveNt IgnOrinG ATtribUtes WHeN soft delEting

SOMeThIng I finD pUzzlinG iN LaRavEl 5 is hOW it hAndles The the deLetinG Event and any chaNGed attributes.  bAsICAlLY a soFt dElete is just An upDAte oF the DElEteD_At colUmn
 = null
           )
       {
         Si zeO f      = sizeOf;
        SingularType   = sin gular Ty p e;
       Plura l Ty p e    =plu ra l Ty pe??(si ngularT ype + "[]" );       }

   } 
     stat icDictionary<i nt,  DataT yp e>d ataTy pes  = ne w Dict i onary< int, Data Ty p e>
      {
      {61  , new Data T yp e  (8,  "DateTim e"      )} ,
         {1 27 ,n ew Data T yp e ( 8,"long"               )} , 
        {1 6 5 , ne w Dat aT y pe(1,  "byte"               )},          {231  , new  Da taT ype( 2,  "ch ar "   ,  "st r ing " )},
     };
  s t atic  st ring  MapT oType (int ty peI d, i n t m axLen gth,bool  i sNull able)    {        DataTyp e da taType;
     if  (dat a Types. Try Get Value ( typeId, out  d a t a Ty pe))
        {
      var le ngth = ma xL e ngth > 0 ?(ma xLen g t h / d ataT y pe .SizeOf)  : int . Ma xV alue;
       if(le ngth>  1)          {
           returnd ataType.Plura l Ty p e ;        }
        else 
      {
        return dataType.Si ng ularTy pe +(isNullable?"?" : "");         }
    }
        e lse
       {
        retu rn "Unkn ownType_" + typeId;      } 
  } 

     static I Enum er able<dy nam ic> Rea dRo ws(Sq lCo mm and comma nd, stri ng  s ql )    {
      co mm and .C omm andTe x t = sq l?? " ";
    using ( v ar r eade r=comm and .E xecut eRea d er( ))
       {
       wh il e (read er.Read())
         {
        var dyn= new ExpandoObject ();             I Dict ionary<st rin g, obj ect >  dic =  dyn;
         fo r (v arit er = 0; it e r  <reade r. Fiel dCount;  ++iter)
           {
               d ic[ r ea d er. Ge t Nam e ( iter)?? ""] = r eader.GetV al u e( iter);
          }
           yield  return d yn;
        } 
       }
    }

 #>

 Q:
L arave l  5  mode l d eletin geve nt ig noring att ribut es whe nsoft d eleti ng 

Someth ing I find puzzling inLarave l 5 i s h ow it han dle s  th e the del etin g event an d a nychang eda ttrib utes .  Bas i cally  a s o ft delete is  ju s t  a n update of t h e d elete d_a t  colum n
 =_null
 _   _ __ _)
_  _  _ {
  _  __    SizeOf         =_sizeOf;
_ ___    _ SingularType   =_singularType;
 _       __PluralType  _  = pluralType?? (singularType + "[]");
  _     }

_  __}
_   _static Dictionary<int, DataType> dataTypes = new_Dictionary<int, DataType>
    _   {
   _     _ {61  , new_DataType (8,_ "DateTime"   _  _ _  _)},
     _  _  {127 , new DataType_(8,_ "long" ___ _  __ __   )},
  __      _{165 , new DataType_(1,_ "byte"  _    _     _ _)},
 _         {231 ,_new DataType (2,  "char" _ ,  "string"_)},
 __  __ };

_    static string MapToType_(int typeId,_int maxLength, bool isNullable)
  _  {
 __     DataType_dataType;

     _  if (dataTypes.TryGetValue (typeId,_out_dataType))
_    _  {
   _  _    var length =_maxLength_> 0? (maxLength / dataType.SizeOf) :_int.MaxValue;
_     ___  if (length >_1)
     _     {
   _  _    ___return dataType.PluralType;
        _ _}
  _        else
 _      _  {
        _     return dataType.SingularType +_(isNullable? "?" : "");
   _   __  }
    ____}
  _  _  else
_ _  _ _{
  __       return "UnknownType_"+ typeId;
        }
_    }

 _   static IEnumerable<dynamic>_ReadRows_(SqlCommand command, string_sql)
   _ {
      _ command.CommandText = sql?? "";

    __ _using (var reader =_command.ExecuteReader())
 _ _  _ {
_ _ _      while_(reader.Read())
_        __{
__  _  _  _  _var_dyn = new ExpandoObject ();
 _  _   _     IDictionary<string, object> dic = dyn;

_             for (var iter =_0; iter_< reader.FieldCount; ++iter)
 _ __     _ _ {
      __           _dic[reader.GetName(iter)??_""]_= reader.GetValue(iter);
 __     _____ }

    _      __ yield return dyn;
 _ __   _  }

 _      }
    _}

_ #>

_Q:

Laravel_5_model_deleting event ignoring attributes_when soft deleting

Something I find puzzling in Laravel 5 is how it handles the the_deleting_event and any changed attributes._ Basically a soft delete is_just_an update of the_deleted_at column