예제 #1
0
        /// <summary>
        /// Gets the clr name according to server defined name in the specified <paramref name="t"/>.
        /// </summary>
        /// <param name="t">Member to get clr name for.</param>
        /// <param name="serverDefinedName">name from server.</param>
        /// <returns>Client clr name.</returns>
        internal static string GetClientFieldName(Type t, string serverDefinedName)
        {
            ODataTypeInfo typeInfo = GetODataTypeInfo(t);

            List <string> serverDefinedNames = serverDefinedName.Split(',').Select(name => name.Trim()).ToList();
            List <string> clientMemberNames  = new List <string>();

            foreach (var serverSideName in serverDefinedNames)
            {
                string memberInfoName = typeInfo.GetClientFieldName(serverSideName);

                clientMemberNames.Add(memberInfoName);
            }

            return(string.Join(",", clientMemberNames));
        }