Exemple #1
0
 private void FieldMerge(IMapAttribute map, DataMapField newField)
 {
     foreach (var o in Fields)
     {
         if (o.DisplayName == newField.DisplayName)
         {
             if (!string.IsNullOrEmpty(newField.Value))
             {
                 o.Value = newField.Value;
             }
         }
     }
 }
Exemple #2
0
        public void Merge(IMapAttribute map)
        {
            var newFields = map.Fields;

            foreach (var o in newFields)
            {
                if (!Contain(o))
                {
                    Fields.Add(o);
                }
                else
                {
                    FieldMerge(map, o);
                }
            }
        }
        /// <summary>
        /// 配置数据映射来源
        /// </summary>
        /// <param name="configure"></param>
        /// <param name="type"></param>
        public static void CreateMapTo(this IMapperConfigurationExpression configure, Type type)
        {
            IMapAttribute attribute = type.GetCustomAttribute <MapToAttribute>();

            if (attribute == null)
            {
                return;
            }

            var ignore = type.GetCustomAttribute <IgnoreMapToAttribute>();

            if (ignore != null)
            {
                return;
            }

            configure.CreateMap(type, attribute.Types, attribute.FromOrTo);
        }
 public ActionAttributeObject(IMapAttribute attr, VariableDirection direct)
 {
     this.attributes = attr;
     Name            = attr.Name;
     Direction       = direct;
 }
Exemple #5
0
 public ActionsModelView(ActionList actionList, IMapAttribute mapAttribute)
 {
     actions      = actionList;
     MapAttribute = mapAttribute;
 }