GetStoreType() публичный Метод

public GetStoreType ( TypeUsage edmType ) : TypeUsage
edmType TypeUsage
Результат TypeUsage
Пример #1
0
    public void CanMapByteTypeToUTinyInt()
    {
      using (MySqlConnection connection = new MySqlConnection(GetConnectionString(true)))
      {
        MySqlProviderManifest pm = new MySqlProviderManifest(Version.ToString());
        TypeUsage tu = TypeUsage.CreateDefaultTypeUsage(
                PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.Byte));
        TypeUsage result = pm.GetStoreType(tu);
        Assert.AreEqual("utinyint", result.EdmType.Name);

      }
    }
Пример #2
0
    public void TestingMaxLengthFacet()
    {
      using (MySqlConnection connection = new MySqlConnection(GetConnectionString(true)))
      {
        MySqlProviderManifest pm = new MySqlProviderManifest(Version.ToString());
        TypeUsage tu = TypeUsage.CreateStringTypeUsage(
          PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.String), false, false);
        TypeUsage result = pm.GetStoreType(tu);
        Assert.AreEqual("longtext", result.EdmType.Name);

        tu = TypeUsage.CreateStringTypeUsage(
          PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.String), false, false, Int32.MaxValue);
        result = pm.GetStoreType(tu);
        Assert.AreEqual("longtext", result.EdmType.Name);

        tu = TypeUsage.CreateStringTypeUsage(
          PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.String), false, false, 70000);
        result = pm.GetStoreType(tu);
        Assert.AreEqual("mediumtext", result.EdmType.Name);

      }
    }