Esempio n. 1
0
        public StatisticSetDTO MapToStatisticSetDTO(StatisticSetEntity source, StatisticSetDTO target = null)
        {
            if (source == null)
            {
                return(null);
            }
            if (target == null)
            {
                target = new StatisticSetDTO();
            }

            MapToVersionDTO(source, target);
            target.Id             = source.Id;
            target.Name           = source.Name;
            target.UpdateInterval = TimeSpanConverter.Convert(source.UpdateInterval);
            target.UpdateTime     = source.UpdateTime.GetValueOrDefault();

            return(target);
        }
Esempio n. 2
0
        public StatisticSetEntity MapToStatisticSetEntity(StatisticSetDTO source, StatisticSetEntity target = null, bool force = false)
        {
            if (source == null)
            {
                return(null);
            }
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            if (MapToRevision(source, target) == false && force == false)
            {
                return(target);
            }

            target.Name                  = source.Name;
            target.UpdateInterval        = TimeSpanConverter.Convert(source.UpdateInterval);
            target.UpdateTime            = source.UpdateTime;
            target.RequiresRecalculation = true;

            return(target);
        }