public Join(EntityDbField fieldA, EntityDbField fieldB, JoinType joinType) { m_JoinID = 1; m_FieldA = fieldA; m_FieldB = fieldB; m_JoinType = joinType; }
public EntityDbFieldIndex(EntityDbField indexedColumn) { if (null == (Object)indexedColumn) { throw new ArgumentNullException("indexedColumn"); } m_IndexedColumn = indexedColumn; }
public void ReadXml(System.Xml.XmlReader r) { using (XmlReader reader = r.ReadSubtree()) { if (reader.Read()) { while (reader.Read()) { if (reader.NodeType == System.Xml.XmlNodeType.Element && !reader.IsEmptyElement) { EntityDbField field = new EntityDbField( XmlConvert.EncodeLocalName(reader.LocalName), (SqlDbType)Enum.Parse(typeof(SqlDbType), reader["dbType"]), Int32.Parse(reader["length"]), GetDbType()); int pos; if ((pos = m_FieldMap.BinarySearch(new EntityFieldMapping(field))) >= 0) { if (m_FieldMap[pos].EntityField.FieldType == typeof(Byte[])) { using (MemoryStream ms = new MemoryStream()) { Byte[] buffer = new Byte[1024]; int read = 0; while ((read = reader.ReadElementContentAsBase64(buffer, 0, 1024)) > 0) { ms.Write(buffer, 0, read); } m_FieldMap[pos].EntityField.SetValue(this, ms.ToArray()); ms.Close(); } } else if (m_FieldMap[pos].EntityField.FieldType.IsGenericType && m_FieldMap[pos].EntityField.FieldType.GetGenericTypeDefinition() == typeof(Nullable <>)) { if (m_FieldMap[pos].EntityField.FieldType.GetGenericArguments()[0] == typeof(Guid)) { m_FieldMap[pos].EntityField.SetValue(this, new Guid(reader.ReadElementContentAsString())); } else { m_FieldMap[pos].EntityField.SetValue(this, reader.ReadElementContentAs(m_FieldMap[pos].EntityField.FieldType.GetGenericArguments()[0], null)); } } else { m_FieldMap[pos].EntityField.SetValue(this, reader.ReadElementContentAs(m_FieldMap[pos].EntityField.FieldType, null)); } } } } } } r.Read(); }
public Expression(EntityDbField field, ExpressionOperator op, object value) : this() { m_Field = field; m_Expr = op; m_Value = value; if (null == m_Value) { m_Value = DBNull.Value; } m_ExpressionID = "expr0"; }
protected void SetFieldModified(EntityDbField field, bool modified) { int pos = m_ModifiedFields.BinarySearch(field); if (modified) { if (pos < 0) { pos = ~pos; m_ModifiedFields.Insert(pos, field); } } else { if (pos >= 0) { m_ModifiedFields.RemoveAt(pos); } } }
public override object GetValueForDbField(EntityDbField field) { return(m_FieldValues[m_Fields.BinarySearch(field)]); }
public override void SetValueForDbField(EntityDbField field, object value) { m_FieldValues[m_Fields.BinarySearch(field)] = value; }
public EntityCollection(EntityDbField indexColumn) { m_Index = new EntityDbFieldIndex(indexColumn); m_IsIndexed = true; }
public virtual bool GetDbFieldValueChanged(EntityDbField field) { return(m_ModifiedFields.BinarySearch(field) >= 0); }
public virtual void SetValueForDbField(EntityDbField field, object value) { int pos = m_FieldMap.BinarySearch(new EntityFieldMapping(field)); m_FieldMap[pos].EntityField.SetValue(this, value); }
public virtual object GetValueForDbField(EntityDbField field) { int pos = m_FieldMap.BinarySearch(new EntityFieldMapping(field)); return(m_FieldMap[pos].EntityField.GetValue(this)); }
protected void AddFieldMapping(EntityDbField dbfield, string objfield) { AddFieldMapping(new EntityFieldMapping(dbfield, objfield, this.GetType())); }
protected void AddFieldMapping(EntityDbField dbfield, string objfield, Type objtype) { AddFieldMapping(new EntityFieldMapping(dbfield, objfield, objtype)); }
public SortExpression(EntityDbField field, SortDirection direction) { m_SortDbField = field; m_SorDirection = direction; }