Exemplo n.º 1
0
        public void Throws_for_naked_type_name(string typeName)
        {
            var mapper = CreateTypeMapper();

            Assert.Equal(
                MySqlStrings.UnqualifiedDataType(typeName),
                Assert.Throws <ArgumentException>(() => mapper.FindMapping(typeName)).Message);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        protected override void ValidateMapping(CoreTypeMapping mapping, IProperty property)
        {
            var relationalMapping = mapping as RelationalTypeMapping;

            if (_disallowedMappings.Contains(relationalMapping?.StoreType))
            {
                if (property == null)
                {
                    throw new ArgumentException(MySqlStrings.UnqualifiedDataType(relationalMapping.StoreType));
                }

                throw new ArgumentException(MySqlStrings.UnqualifiedDataTypeOnProperty(relationalMapping.StoreType, property.Name));
            }
        }