/// <summary> /// Saves the specified entity using the specified data provider. /// </summary> /// <param name="entity"></param> /// <param name="provider"></param> /// <param name="deep"></param> /// <param name="transactionContext"></param> /// <returns></returns> public static DataModel <TEntity> Save(TEntity entity, DataProviderBase provider, bool deep, DbTransaction transactionContext) { var model = new DataModel <TEntity>(entity); if (deep) { provider.DeepSaveModel(model, transactionContext); } else { provider.SaveModel(model, transactionContext); } return(model); }