string.AddNamespace(AppliesToType)

Here are the examples of the csharp api class string.AddNamespace(AppliesToType) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

1. Example

Project: ValidationTool
Source File: MappingHelper.cs
View license
public static bool IsSpecifiedComplexTypeFullNameExist(this string complexTypeFullName)
        {
            if (string.IsNullOrEmpty(complexTypeFullName))
            {
                return false;
            }

            string complexTypeShortName = complexTypeFullName.GetLastSegment();
            string comparedName = complexTypeShortName.AddNamespace(AppliesToType.ComplexType, ServiceStatus.GetInstance().MetadataDocument);

            return comparedName == complexTypeFullName;
        }

2. Example

Project: ValidationTool
Source File: MappingHelper.cs
View license
public static bool IsSpecifiedEntityTypeFullNameExist(this string entityTypeFullName)
        {
            if (string.IsNullOrEmpty(entityTypeFullName))
            {
                return false;
            }

            string entityTypeShortName = entityTypeFullName.GetLastSegment();
            string comparedName = entityTypeShortName.AddNamespace(AppliesToType.EntityType, ServiceStatus.GetInstance().MetadataDocument);

            return comparedName == entityTypeFullName;
        }

3. Example

Project: ValidationTool
Source File: MappingHelper.cs
View license
public static bool IsSpecifiedTypeFullNameExist(this string typeFullName)
        {
            if (string.IsNullOrEmpty(typeFullName))
            {
                return false;
            }

            string typeShortName = typeFullName.GetLastSegment();
            string comparedName1 = typeShortName.AddNamespace(AppliesToType.EntityType, ServiceStatus.GetInstance().MetadataDocument);
            string comparedName2 = typeShortName.AddNamespace(AppliesToType.ComplexType, ServiceStatus.GetInstance().MetadataDocument);

            return comparedName1 == typeFullName || comparedName2 == typeFullName;
        }

4. Example

Project: ValidationTool
Source File: MappingHelper.cs
View license
public static string MapEntityTypeShortNameToEntitySetName(this string entityTypeShortName)
        {
            if (string.IsNullOrEmpty(entityTypeShortName))
            {
                throw new ArgumentNullException(string.Format(ParamNullErrorMsgPattern, "entityTypeShortName"));
            }

            if (!IsSpecifiedEntityTypeShortNameExist(entityTypeShortName))
            {
                throw new ArgumentException(string.Format(ParamNotFoundErrorMsgPattern, "entity-type", "short name", "entityTypeShortName"));
            }

            string entityTypeFullName = entityTypeShortName.AddNamespace(AppliesToType.EntityType, ServiceStatus.GetInstance().MetadataDocument);

            return entityTypeFullName.MapEntityTypeFullNameToEntitySetName();
        }

5. Example

Project: ValidationTool
Source File: MappingHelper.cs
View license
public static string MapEntityTypeShortNameToEntitySetURL(this string entityTypeShortName)
        {
            if (string.IsNullOrEmpty(entityTypeShortName))
            {
                throw new ArgumentNullException(string.Format(ParamNullErrorMsgPattern, "entityTypeShortName"));
            }

            if (!IsSpecifiedEntityTypeShortNameExist(entityTypeShortName))
            {
                throw new ArgumentException(string.Format(ParamNotFoundErrorMsgPattern, "entity-type", "short name", "entityTypeShortName"));
            }

            string entityTypeFullName = entityTypeShortName.AddNamespace(AppliesToType.EntityType, ServiceStatus.GetInstance().MetadataDocument);

            if (!string.IsNullOrEmpty(entityTypeFullName))
            {
                string entitySetName = entityTypeFullName.MapEntityTypeFullNameToEntitySetName();

                if (!string.IsNullOrEmpty(entitySetName))
                {
                    return entitySetName.MapEntitySetNameToEntitySetURL();
                }
            }

            return string.Empty;
        }

6. Example

Project: ValidationTool
Source File: MappingHelper.cs
View license
private static Queue<string> GetAccessEntitySetPathNodes(this string entityTypeShortName)
    /n ..... /n //View Source file for more details /n }