Ejemplo n.º 1
0
        protected override ViewModelMetadata CreateDefaultMetadata()
        {
            if (Reflection != null)
            {
                if (Reflection.PropertyInfo != null)
                {
                    var propertyInfo = Reflection.PropertyInfo;
                    var attr         = propertyInfo.GetCustomAttributes(typeof(ViewModelMetadataAttribute), true).Cast <ViewModelMetadataAttribute>().FirstOrDefault();
                    if (attr != null)
                    {
                        if (attr.MetadataType != null)
                        {
                            var metaData = (ViewModelMetadata)Activator.CreateInstance(attr.MetadataType);
                            return(metaData);
                        }
                    }
                }
            }
            var metadata = new ValueMetadata <T>();

            if (_enableBusinessModelFeatures)
            {
                metadata.EnableBusinessModelFeatures = true;
            }
            return(metadata);
        }
Ejemplo n.º 2
0
 public static Guid?GetId(this IValue v)
 {
     return(ValueMetadata.ForValue(v).Id);
 }
Ejemplo n.º 3
0
 public static IValue SetId(this IValue v, Guid?id)
 {
     ValueMetadata.ForValue(v).Id = id;
     return(v);
 }
Ejemplo n.º 4
0
 public static String GetTypeToken(this IValue v)
 {
     return(ValueMetadata.ForValue(v).TypeToken);
 }
Ejemplo n.º 5
0
 public static IValue SetTypeToken(this IValue v, String typeToken)
 {
     ValueMetadata.ForValue(v).TypeToken = typeToken;
     return(v);
 }