I just ran into this using EF5 / DbContext. The solution I found is to edit the T4 template ([Model] .Context.tt) that the DbContext generates.
In this file, find the instructions for generating an ExecuteFunction call. For me, it started on line 288:
public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) { var parameters = _typeMapper.GetParameters(edmFunction); var returnType = _typeMapper.GetReturnType(edmFunction); var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); if (includeMergeOption) { callParams = ", mergeOption" + callParams; } return string.Format( CultureInfo.InvariantCulture, "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", edmFunction.Name, callParams); }
Change the return line so that edmFunction.Name is replaced with edmFunction.FullName , and when you save, the Import function code will be regenerated using fully qualified names.
source share