public ResolutionResult Resolve(ResolutionResult source) { var propertyMap = source.Context.PropertyMap; propertyMap.ShouldNotBeNull(); var codeValueTypeId = propertyMap.SourceMember.DeclaringType.Name + ":" + propertyMap.SourceMember.Name; return source.New(LookupCodeValue(codeValueTypeId, "" + source.Value)); }
public ResolutionResult Resolve(ResolutionResult source) { if (_nullSubstitute == null) { return source; } return source.Value == null ? source.New(_nullSubstitute) : source; }
public ResolutionResult Resolve(ResolutionResult source) { try { return _inner.Resolve(source); } catch (NullReferenceException) { return source.New(null, MemberType); } }
public ResolutionResult Resolve(ResolutionResult source) { if (source.Value == null) return source; var valueType = source.Value.GetType(); if (!(_sourceType.IsAssignableFrom(valueType))) throw new ArgumentException("Expected obj to be of type " + _sourceType + " but was " + valueType); var result = _propertyInfo.GetValue(source.Value, null); return source.New(result); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New(DomainEntityState.Unchanged)); }
public ResolutionResult Resolve(ResolutionResult source) { return source.New(source.Value); }
public ResolutionResult Resolve(ResolutionResult source) { var pp = source.Value as IEnumerable <PricePosition>; return(pp != null?source.New(!pp.Any()? 0 : pp.Min(x => x.Price)) : source.New(0)); }
public ResolutionResult Resolve(ResolutionResult source) { return source.New((int) source.Value + (int)source.Context.Options.Items["Item"]); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New(Guid.NewGuid())); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New(((int)source.Value) + 5)); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New((int)source.Value + (int)source.Context.Options.Items["Item"])); }
public ResolutionResult Resolve(ResolutionResult source) { return source.New(-1); }
public ResolutionResult Resolve(ResolutionResult source) { var result = GetValueFromKey(property, source.Value); // gets from some static cache or dictionary elsewhere in your code by reading the prop info and then using that to look up the value based on the key as appropriate return source.New(result) }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New(ResolveCore(source, (IMember)source.Value), typeof(string))); }
public ResolutionResult Resolve(ResolutionResult context) { var value = (long)context.Value; return(context.New(FileSizeFormatter.FormatValue(value))); }
/// <summary> /// Implementors use source resolution result to provide a destination resolution result. /// Use the <see cref="T:AutoMapper.ValueResolver`2"/> class for a type-safe version. /// </summary> /// <param name="source">Source resolution result</param> /// <returns> /// Result, typically build from the source resolution result /// </returns> public ResolutionResult Resolve(ResolutionResult source) { TEntity entry = this.ResolveCore(source.Value); return(source.New(entry, typeof(TEntity))); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New((source.Context.SourceValue as DataRow)[source.Context.MemberName])); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New(-1)); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New(((ModelSubObject)source.Value).SomeValue + 1)); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.Value == null ? source.New(source.Value, MemberType) : source.New(GetValue(source.Value), MemberType)); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New(((ModelObject)source.Value).Value4 + 4)); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New(ResolveObject(source))); }
public ResolutionResult Resolve(ResolutionResult source) { return source.Value == null ? source.New(source.Value, MemberType) : source.New(GetValue(source.Value), MemberType); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New(((Order)source.Value).Status)); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New(((TOutputEnum)Enum.Parse(typeof(TOutputEnum), Enum.GetName(typeof(TInputEnum), source.Value), false)))); }
public ResolutionResult Resolve(ResolutionResult source) { return(source.New(Convert.ChangeType((source.Context.SourceValue as DataRow)[source.Context.MemberName], source.Context.DestinationType))); }