示例#1
0
        public static LinkedInput MapFromDTO(string linkedInputDTO)
        {
            LinkedInput domain = new LinkedInput();

            if (string.IsNullOrEmpty(linkedInputDTO))
            {
                return(Empty());
            }

            try
            {
                string[] array = linkedInputDTO.Split(',');

                if (array.Count() == 0)
                {
                    domain = Empty();
                }
                else if (array.Count() >= 10)
                {
                    domain.SourceFieldType     = Convert.ToInt32(array[0]).EnumValue <FieldTypeEnum>();
                    domain.SourceDataModelType = Convert.ToInt32(array[1]).EnumValue <DataModelTypeEnum>();

                    domain.SourceLinkFieldName     = array[2];
                    domain.SourceLinkPrimitiveType = Convert.ToInt32(array[3]).EnumValue <PrimitiveTypeEnum>();

                    domain.TargetDataModelType = Convert.ToInt32(array[4]).EnumValue <DataModelTypeEnum>();
                    domain.TargetFieldType     = Convert.ToInt32(array[5]).EnumValue <FieldTypeEnum>();

                    domain.TargetLinkFieldName     = array[6];
                    domain.TargetLinkPrimitiveType = Convert.ToInt32(array[7]).EnumValue <PrimitiveTypeEnum>();

                    domain.TargetFieldName     = array[8];
                    domain.TargetPrimitiveType = Convert.ToInt32(array[9]).EnumValue <PrimitiveTypeEnum>();
                }
            }
            catch (Exception)
            {
                return(Empty());
            }

            return(domain);
        }
示例#2
0
        public static string MapToDTO(LinkedInput linkedInput)
        {
            if (linkedInput == null)
            {
                return($"");
            }

            int    sft  = (int)linkedInput.SourceFieldType;
            int    sdmt = (int)linkedInput.SourceDataModelType;
            string slfn = linkedInput.SourceLinkFieldName;
            int    slpt = (int)linkedInput.SourceLinkPrimitiveType;

            int    tgmt = (int)linkedInput.TargetDataModelType;
            int    tft  = (int)linkedInput.TargetFieldType;
            string tlfn = linkedInput.TargetLinkFieldName;
            int    tlpt = (int)linkedInput.TargetLinkPrimitiveType;

            string tfn = linkedInput.TargetFieldName;
            int    tpt = (int)linkedInput.TargetPrimitiveType;

            return($"{sft.ToString()},{sdmt.ToString()},{slfn},{slpt.ToString()},{tgmt.ToString()},{tft.ToString()},{tlfn},{tlpt.ToString()},{tfn},{tpt.ToString()}");
        }
示例#3
0
 public static bool IsEmpty(LinkedInput linkedInput) => Object.Equals(Empty(), linkedInput);
示例#4
0
 public static DataModelTypeEnum GetTargetDataModelType(LinkedInput linkedInput)
 => linkedInput?.TargetDataModelType ?? DataModelTypeEnum.None;
示例#5
0
 public static DataModelTypeEnum GetSourceDataModelType(LinkedInput linkedInput)
 => linkedInput?.SourceDataModelType ?? DataModelTypeEnum.None;
示例#6
0
 public static FieldTypeEnum GetTargetFieldType(LinkedInput linkedInput)
 => linkedInput?.TargetFieldType ?? FieldTypeEnum.None;
示例#7
0
 public static FieldTypeEnum GetSourceFieldType(LinkedInput linkedInput)
 => linkedInput?.SourceFieldType ?? FieldTypeEnum.None;
示例#8
0
 public static PrimitiveTypeEnum GetTargetPrimitiveType(LinkedInput linkedInput)
 => linkedInput?.TargetPrimitiveType ?? PrimitiveTypeEnum.None;