示例#1
0
 public override DataStore CreateDataStore()
 {
     SqlDataStore dataStore = new Inform.Sql.SqlDataStore();
     dataStore.Name = "Main";
     dataStore.Connection.ConnectionString = "server=localhost;database=Inform;uid=development;pwd=d3v3lopm3nt";
     return dataStore;
 }
 public override DataStore CreateDataStore()
 {
     SqlDataStore dataStore = new SqlDataStore();
     dataStore.Connection.ConnectionString = "server=localhost;database=Inform;uid=development;pwd=d3v3lopm3nt";
     dataStore.Settings.UseStoredProcedures = true;
     return dataStore;
 }
示例#3
0
        public void InitializeConnection()
        {
            dataStore = new SqlDataStore();
            dataStore.Connection.ConnectionString = "server=localhost;database=Inform;uid=development;pwd=d3v3lopm3nt";
            dataStore.Settings.AutoGenerate = true;
            dataStore.Settings.UseStoredProcedures = true;

            dataStore.CreateStorage(typeof(Employee));

            Employee e = new Employee();
            e.EmployeeID = "2";
            e.FirstName = "Sam";
            e.LastName = "Donaldson";
            e.Title = "Director";
            e.Salary = 70000;
            dataStore.Insert(e);

            Employee e2 = new Employee();
            e2.EmployeeID = "3";
            e2.FirstName = "Jim";
            e2.LastName = "Davis";
            e2.Title = "Director";
            e2.Salary = 65000;
            dataStore.Insert(e2);
        }
示例#4
0
 /// <summary>
 /// Creates a new SqlObjectReader.
 /// </summary>
 internal SqlObjectReader(SqlDataStore dataStore, SqlDataReader reader, Type mappedType, bool polymorphic)
 {
     this.dataStore = dataStore;
     this.reader = reader;
     this.polymorphic = polymorphic;
     this.MappedType = mappedType;
 }
示例#5
0
        public SqlObjectAccessCommand(SqlDataStore dataStore, Type dynamicType, string cmdText, bool polymorphic, CommandType commandType)
        {
            this.dataStore = dataStore;
            this.cmdText = cmdText;
            this.polymorphic = polymorphic;
            this.dynamicType = dynamicType;
            this.commandType = commandType;

            if(commandType == CommandType.Text){
                command = new SqlDataAccessCommand(dataStore, dataStore.DataStorageManager.CreateQuery(dynamicType, cmdText, polymorphic), commandType);
            } else {
                command = new SqlDataAccessCommand(dataStore, cmdText, commandType);
            }
        }
示例#6
0
 public SqlObjectAccessCommand(SqlDataStore dataStore, Type dynamicType, string filter, bool polymorphic)
     : this(dataStore, dynamicType, filter, false, CommandType.Text)
 {
 }
示例#7
0
 public SqlObjectAccessCommand(SqlDataStore dataStore, Type dynamicType, string filter)
     : this(dataStore, dynamicType, filter, false)
 {
 }
示例#8
0
 public SqlDataStorageManager(SqlDataStore dataStore)
     : base(dataStore)
 {
     AddDefaultPropertyMappingsTypes();
 }
示例#9
0
 /// <summary>
 /// Creates the command as a specific command type.
 /// </summary>
 public SqlDataAccessCommand(SqlDataStore dataStore, string cmdText, System.Data.CommandType commandType)
 {
     this.dataStore = dataStore;
     this.command = new SqlCommand(cmdText);
     this.command.CommandType = commandType;
 }
示例#10
0
 /// <summary>
 /// Creates the command.
 /// </summary>
 public SqlDataAccessCommand(SqlDataStore dataStore, string cmdText)
 {
     this.dataStore = dataStore;
     this.command = new SqlCommand(cmdText);
 }
示例#11
0
 /// <summary>
 /// Creates a new SqlFindObject Command.
 /// </summary>
 /// <param name="storeProcedureName">The name of the stored procedure to call.</param>
 public SqlFindCollectionCommand(SqlDataStore dataStore, Type dynamicType, string filter, bool polymorphic)
     : base(dataStore, dynamicType, filter, polymorphic)
 {
 }
示例#12
0
 /// <summary>
 /// Creates a new SqlFindCollectionCommand Command.
 /// </summary>
 /// <param name="storeProcedureName">The name of the stored procedure to call.</param>
 /// <param name="dynamicObjectType">The type of object to populate dynamically.</param>
 public SqlFindCollectionCommand(SqlDataStore dataStore,  Type dynamicType, String cmdText, CommandType commandType)
     : base(dataStore, dynamicType, cmdText, false, commandType)
 {
 }
示例#13
0
 /// <summary>
 /// Creates a new SqlFindCollectionCommand Command.
 /// </summary>
 /// <param name="storeProcedureName">The name of the stored procedure to call.</param>
 /// <param name="dynamicObjectType">The type of object to populate dynamically.</param>
 public SqlFindCollectionCommand(SqlDataStore dataStore, Type dynamicType, String filter )
     : base(dataStore, dynamicType, filter)
 {
 }
示例#14
0
 /// <summary>
 /// Creates a new SqlFindObject Command.
 /// </summary>
 /// <param name="dynamicObjectType">The type of object to populate dynamically.</param>
 public SqlFindObjectCommand(SqlDataStore dataStore, Type dynamicType, string cmdText, bool polymorphic, System.Data.CommandType commandType)
 {
     this.dataStore = dataStore;
     this.m_command = new SqlObjectAccessCommand(dataStore, dynamicType, cmdText, polymorphic, commandType);
 }
示例#15
0
 /// <summary>
 /// Creates a new SqlFindObject Command.
 /// </summary>
 public SqlFindObjectCommand(SqlDataStore dataStore, Type dynamicType, string filter, bool polymorphic)
     : this(dataStore, dynamicType, filter, polymorphic, CommandType.Text)
 {
 }