diff Source/Data/DataProvider/DataProviderInterpreterBase.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Source/Data/DataProvider/DataProviderInterpreterBase.cs	Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,51 @@
+using System.Collections.Generic;
+using System.Data;
+using BLToolkit.Mapping;
+
+namespace BLToolkit.Data.DataProvider
+{
+    /// <summary>
+    /// BasicSqlProvider equivalent for the non-linq DAL
+    /// </summary>
+    public abstract class DataProviderInterpreterBase
+    {
+        public virtual void SetParameterValue(IDbDataParameter parameter, object value)
+        {
+            if (value is System.Data.Linq.Binary)
+            {
+                var arr = ((System.Data.Linq.Binary)value).ToArray();
+
+                parameter.Value = arr;
+                parameter.DbType = DbType.Binary;
+                parameter.Size = arr.Length;
+            }
+            else
+                parameter.Value = value;
+        }
+
+        public virtual List<string> GetInsertBatchSqlList<T>(
+            string              insertText, 
+            IEnumerable<T>      collection, 
+            MemberMapper[]      members, 
+            int                 maxBatchSize, 
+            bool                withIdentity)
+        {
+            return new List<string>();
+        }
+
+        public virtual string GetSequenceQuery(string sequenceName)
+        {
+            return null;
+        }
+
+        public virtual string NextSequenceQuery(string sequenceName)
+        {
+            return null;
+        }
+
+        public virtual string GetReturningInto(string columnName)
+        {
+            return null;
+        }
+    }
+}
\ No newline at end of file