Exemple #1
0
        public void Build(object obj)
        {
            A4ormObject returnValue = new A4ormObject();

            if (obj is IHasId)
            {
                IHasId iHasId = obj as IHasId;
                returnValue.Id = iHasId.Id;
            }
            else
            {
                //autogen id
                returnValue.Id = Guid.NewGuid().ToString();
            }

            //walk the object
            var meta = TypeMetaCache.Instance.GetTypeMeta(obj.GetType());

            meta.Properties.WithEach(propMeta =>
            {
                A4ormProperty prop = new A4ormProperty();
                prop.Type          = propMeta.Type;
            });
            var inspector = ObjectInspectorCache.Instance.GetInspector(obj.GetType());



            return(returnValue);
        }
Exemple #2
0
        public void Build(object obj)
        {
            A4ormObject returnValue = new A4ormObject();
            if (obj is IHasId)
            {
                IHasId iHasId = obj as IHasId;
                returnValue.Id = iHasId.Id;
            }
            else
            {
                //autogen id
                returnValue.Id = Guid.NewGuid().ToString();
            }

            //walk the object
            var meta = TypeMetaCache.Instance.GetTypeMeta(obj.GetType());

            meta.Properties.WithEach(propMeta =>
            {
                A4ormProperty prop = new A4ormProperty();
                prop.Type = propMeta.Type;

            });
            var inspector = ObjectInspectorCache.Instance.GetInspector(obj.GetType());
            


            return returnValue;
        }