public EntityModelType GetModelMetadata(Type modelType)
        {
            EntityModelType entityModelType = null;

            Metadata.TryGetValue(modelType, out entityModelType);

            return(entityModelType);
        }
        public EntityModelType AddModelMetadata(string entityLogicalName, Type modelType)
        {
            EntityModelType entityModelType = new EntityModelType(entityLogicalName);

            IEnumerable <PropertyInfo> properties = modelType
                                                    .GetProperties()
                                                    .Where(pi => pi.CanRead);

            foreach (var currentPropertyInfo in properties)
            {
                string attributeLogicalName = GetCRMAttributeLogicalName(currentPropertyInfo);

                entityModelType.ParameterToAttributeLogicalName.Add(currentPropertyInfo.Name, attributeLogicalName);
            }

            Metadata.TryAdd(modelType, entityModelType);

            return(entityModelType);
        }