public bool GetMeberOperationHelper(string key, out MeberOperationHelper meberOperationHelper) { if (this.dict.TryGetValue(key, out meberOperationHelper)) { return true; } using (Dictionary<string, MeberOperationHelper>.Enumerator enumerator = this.dict.GetEnumerator()) { KeyValuePair<string, MeberOperationHelper> current; while (enumerator.MoveNext()) { current = enumerator.Current; if (string.Compare(current.Value.GetDbColumnAttribute().Alias, key, StringComparison.OrdinalIgnoreCase) == 0) { goto Label_0058; } } goto Label_0073; Label_0058: meberOperationHelper = current.Value; return true; } Label_0073: return false; }
private static string GetReaderStr(MeberOperationHelper meberOperationHelper) { Type type = meberOperationHelper.GetPropertyType(); if (type == TypeInfo.TypeInt) { return "reader.GetInt32"; } if (type == TypeInfo.TypeString) { return "reader.GetString"; } if (type == TypeInfo.TypeDatetime) { return "reader.GetDateTime"; } if (type == TypeInfo.TypeDecimal) { return "reader.GetDecimal"; } if (type == TypeInfo.TypeBool) { return "reader.GetBoolean"; } if (type == TypeInfo.TypeLong) { return "reader.GetInt64"; } if (type == TypeInfo.TypeShort) { return "reader.GetInt16"; } if (type == TypeInfo.TypeFloat) { return "reader.GetFloat"; } if (type == TypeInfo.TypeDouble) { return "reader.GetDouble"; } if (type == TypeInfo.TypeGuid) { return "reader.GetGuid"; } if (type == TypeInfo.TypeByte) { return "reader.GetByte"; } return string.Format("({0})reader.GetValue", meberOperationHelper.GetPropertyType().GetGenericArgumentsString()); }
private static bool InnerSetPropertyValueFromReader(DataReaderAdapeter dataReaderAdapeter, object obj, MeberOperationHelper meberOperationHelper, string string_0) { string[] array = ((ClassDelegateInfo) dataReaderAdapeter.obj).ColumnNames; string str = string_0 + meberOperationHelper.GetDbColumnAttribute().Alias; int num = array.FindIndex(str); if (num < 0) { return false; } object dbValue = dataReaderAdapeter.GetValue(num); return (DBNull.Value.Equals(dbValue) || meberOperationHelper.SetPropertyValue(obj, dbValue)); }
public void SetMeberOperationHelperValue(DbColumnAttribute dbColumnAttribute, MemberOperationBase memberOperationBase) { MeberOperationHelper meberOperationHelper = new MeberOperationHelper(dbColumnAttribute, memberOperationBase) { MeberOperationHelperContainer = this }; this.GetDict()[memberOperationBase.GetPropertyName()] = meberOperationHelper; }