コード例 #1
0
        protected internal virtual Guid InternalSave(object value)
        {
            BigDataStoreTransferModel bigDataStoreTransferModel = value.ConvertToBigDataStoreModel();

            new BigDataStoreProvider().Insert(bigDataStoreTransferModel);
            return(Guid.NewGuid());
        }
コード例 #2
0
        public static BigDataStoreTransferModel ConvertToBigDataStoreModel(this object value)
        {
            var bigDataStoreTransferModel = new BigDataStoreTransferModel(value.ToString());

            Type myType = value.GetType();
            IList <PropertyInfo> props = new List <PropertyInfo>(myType.GetProperties());

            foreach (PropertyInfo prop in props)
            {
                if (prop.Name == "Id")
                {
                    continue;
                }
                Mapping(value, prop, bigDataStoreTransferModel);
            }

            return(bigDataStoreTransferModel);
        }
コード例 #3
0
        private static void Mapping(object value, PropertyInfo prop, BigDataStoreTransferModel bigDataStoreTransferModel)
        {
            object propValue = prop.GetValue(value, null);

            bigDataStoreTransferModel.FillToDic(prop.Name, prop.PropertyType, propValue);
        }
コード例 #4
0
 public Guid Insert(BigDataStoreTransferModel bigDataStoreTransferModel)
 {
     return(Guid.NewGuid());
 }