I've create new web site based on 'Dynamic Data Site' template. 3 tables were added into it: Product, ProductSKU, SkuPrice. There are relationships between tables:
Product.ProdId=ProductSku.ProdId
ProductSku.SkuId=SkuPrice.SkuId
I don't want user to see 'Product' table, so I've hidden that table:
namespace CompanyDbAdmin
{
[MetadataType(typeof(ProductMetadata))]
public partial class Product
{
}
[ScaffoldTable(false)]
public class ProductMetadata
{
}
}
When I tried to hide some columns in 'ProductSKU' table:
namespace CompanyDbAdmin
{
[MetadataType(typeof(ProductSKUMetadata))]
public partial class ProductSKU
{
}
public class ProductSKUMetadata
{
[ScaffoldColumn(false)]
public object MyCollumnName { get; set; }
}
}
I've discovered that doesn't work: column is still displayed. The problem seems like that 'ProductSKU' class is not 'matched' to existing table...
Here is auto-generated code for that table:
namespace CompanyDbAdmin
{
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmEntityTypeAttribute(NamespaceName="SotiModel", Name="ProductSKU")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class ProductSKU : EntityObject
{
....
}
}
Attempt to hide this table with
namespace CompanyDbAdmin
{
[MetadataType(typeof(ProductSKUMetadata))]
public partial class ProductSKU
{
}
[ScaffoldTable(false)]
public class ProductSKUMetadata
{
[ScaffoldColumn(false)]
public object MyCollumnName { get; set; }
}
}
Doesn't work also: table still exists on the 1st page...
Why? How to fix that?
Thanks a lot!