public Metadata(Metadata metadata, Type containerType)
     : this()
 {
     ContainerType = containerType;
     ModelName = metadata.ModelName;
     ModelType = metadata.ModelType;
     CopyMetaDataFrom(metadata);
 }
 internal void CopyMetaDataFrom(Metadata metadata)
 {
     Required = metadata.Required;
     StringLength = metadata.StringLength;
     ErrorMessage = metadata.ErrorMessage;
     DataTypeName = metadata.DataTypeName;
     Readonly = metadata.Readonly;
     ShowDisplay = metadata.ShowDisplay;
     ShowEditor = metadata.ShowEditor;
     TemplateHint = metadata.TemplateHint;
     NullDisplayText = metadata.NullDisplayText;
     DisplayName = metadata.DisplayName;
     foreach (var rule in metadata.Rules)
     {
         AddRule(rule);
     }
 }