Пример #1
0
        public static AnalyticStatisticsItemDto FromEntityToDto(AnalyticStatisticsItemEntity source)
        {
            AnalyticStatisticsItemDto target = new AnalyticStatisticsItemDto();

            target.Id                     = source.Id;
            target.DateGenerated          = source.DateGenerated;
            target.TargetEngineFamilyType = source.TargetEngineFamilyType;
            target.TargetEngineType       = source.TargetEngineType;
            target.Type                   = source.Type;
            target.VersionGenerated       = source.VersionGenerated;
            foreach (AnalyticStatisticsValueEntity value in source.AnalyticStatisticsValue)
            {
                target.Values.Add(AnalyticStatisticsValueAssembler.FromEntityToDto(value));
            }
            return(target);
        }
Пример #2
0
        public static AnalyticStatisticsItem FromDtoToDomainObject(AnalyticStatisticsItemDto source)
        {
            AnalyticStatisticsItem target = new AnalyticStatisticsItem(
                (AnalyticRuleType)source.Type,
                (EngineFamilyType)source.TargetEngineFamilyType,
                (EngineType)source.TargetEngineType);

            target.DateGenerated    = source.DateGenerated;
            target.Id               = source.Id;
            target.VersionGenerated = new Version(source.VersionGenerated);
            foreach (AnalyticStatisticsValueDto value in source.Values)
            {
                target.Values.Add(AnalyticStatisticsValueAssembler.FromDtoToDomainObject(value));
            }
            return(target);
        }
Пример #3
0
        public static AnalyticStatisticsItemDto FromDomainObjectToDto(AnalyticStatisticsItem source)
        {
            AnalyticStatisticsItemDto target = new AnalyticStatisticsItemDto();

            target.Values                 = new List <AnalyticStatisticsValueDto>();
            target.Id                     = source.Id;
            target.DateGenerated          = source.DateGenerated;
            target.TargetEngineFamilyType = (int)source.TargetEngineFamilyType;
            target.TargetEngineType       = (int)source.TargetEngineType;
            target.Type                   = (int)source.Type;
            target.VersionGenerated       = source.VersionGenerated.ToString();
            foreach (AnalyticStatisticsValue value in source.Values)
            {
                target.Values.Add(AnalyticStatisticsValueAssembler.FromDomainObjectToDto(value));
            }
            return(target);
        }