protected internal virtual Guid InternalSave(object value) { BigDataStoreTransferModel bigDataStoreTransferModel = value.ConvertToBigDataStoreModel(); new BigDataStoreProvider().Insert(bigDataStoreTransferModel); return(Guid.NewGuid()); }
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); }
private static void Mapping(object value, PropertyInfo prop, BigDataStoreTransferModel bigDataStoreTransferModel) { object propValue = prop.GetValue(value, null); bigDataStoreTransferModel.FillToDic(prop.Name, prop.PropertyType, propValue); }
public Guid Insert(BigDataStoreTransferModel bigDataStoreTransferModel) { return(Guid.NewGuid()); }