0
Как локализовать с помощью файлов ресурсов DisplayName для класса. Атрибут отображения не работает в классах, а атрибут DisplayName не поддерживает локализацию.Как локализовать отображаемое имя класса
[MetadataTypeAttribute(typeof(ServiceType.ServiceTypeMetadata))]
// Compile Error: Attribute 'Display' is not valid on this declaration type. It is only valid on 'method, property, indexer, field, param' declarations.
// [Display(ResourceType = typeof(Resources.DisplayNames), Name = "ServiceType")]
[System.ComponentModel.DisplayName("Service Type")]
public partial class ServiceType : ILookupEntity<EdmBilingualStringVarCharSingleLine>, ISelectListEntity, IUpdateableEntity
{
#region Metadata
internal sealed class ServiceTypeMetadata
{
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
[Display(ResourceType = typeof(Resources.DisplayNames), Name = "InactiveDate")]
public DateTime? InactiveDate { get; set; }
[Display(ResourceType = typeof(Resources.DisplayNames), Name = "ModifiedBy")]
[Required]
public string ModifiedBy { get; set; }
[Display(ResourceType = typeof(Resources.DisplayNames), Name = "ModifiedDate")]
[Required]
public System.DateTime ModifiedDate { get; set; }
}
#endregion
// ... the rest of the class ....
}