Beispiel #1
0
        private string InsertQuery(ClassProxy _proxy)
        {
            List <FieldValue> _fieldsValues = FieldsValues(_proxy.Properties(), _proxy);
            string            _query        = "INSERT INTO " + _proxy.TypeName.ToLower() +
                                              "(objectrepresentation," + Fields(_fieldsValues) + ") " +
                                              "VALUES (" + "'" + SqlCSharp.ObjectRepresentaition(_proxy.Entity) + "'" + "," + Values(_fieldsValues) + ");";

            return(_query);
        }
Beispiel #2
0
        private string IncludeAllQuery(ClassProxy _classProxy)
        {
            string _query = "";

            foreach (PropertyProxy _memberProxy in _classProxy.Properties())
            {
                if (_memberProxy.IsObject)
                {
                    _query += IncludeClassQuery((PropertyObjectProxy)_memberProxy);
                }
                else
                if (_memberProxy.IsList)
                {
                    Type _itemsType = ((PropertyListProxy)_memberProxy).ItemsType;
                    if (_itemsType == typeof(Base) || _itemsType.IsSubclassOf(typeof(Base)))
                    {
                        _query += IncludeListQuery((PropertyListProxy)_memberProxy);
                    }
                }
            }
            return(_query);
        }