protected string GetColumnName(IClassMapper map, string propertyName, bool includeAlias) { var propertyMap = map.GetJoinedMapByName(propertyName); if (propertyMap == null) { throw new ArgumentException(string.Format("Could not find '{0}' in Mapping.", propertyName)); } return(GetColumnName(map, propertyMap, includeAlias)); }
private string GetUpdateParameterSql(IClassMapper classMapper, IProjectionSet projectionSet, IDictionary <string, object> parameters) { var propertyMap = classMapper.GetJoinedMapByName(projectionSet.PropertyName); if (propertyMap.Ignored || propertyMap.IsReadOnly) { throw new InvalidOperationException($"Update is not allowed for ignored or readonly property [{propertyMap.Name}]"); } var paramName = $"{Configuration.Dialect.ParameterPrefix}{propertyMap.Name}"; parameters.Add(paramName, projectionSet.Value); return($"{classMapper.GetColumnName(propertyMap,Configuration.Dialect,false)} = {paramName}"); }
public static IPropertyMap GetPropertyMapByName(this IClassMapper classMapper, string propertyName) { return(classMapper.GetJoinedMapByName(propertyName)); }