Exemple #1
0
        public void UpdateProcessing <T>(IItem domain) where T : class, IItemEntity
        {
            if (_lifeManagerRepository.LoadEntity <T>(domain.Id) == null)
            {
                FailReferencingVerb("update", domain.Id, typeof(T));
            }

            // TODO: Check if the object differs from the existing object.
            // TODO: It may be better to move UpdateProcessing calls within the SaveEntity call, so that we can compare the two entity models.
            domain.DateTimeLastModified = DateTime.Now;
        }
Exemple #2
0
        public Chore GetById(long id)
        {
            ChoreEntity entity = _lifeManagerRepository.LoadEntity <ChoreEntity>(id);

            if (entity == null)
            {
                return(null);
            }

            return(_choreMapper.ToDomain(entity));
        }
        public LeisureActivity GetById(long id)
        {
            LeisureActivityEntity entity = _lifeManagerRepository.LoadEntity <LeisureActivityEntity>(id);

            if (entity == null)
            {
                return(null);
            }

            return(_leisureActivityMapper.ToDomain(entity));
        }
        public RecurringTask GetById(long id)
        {
            RecurringTaskEntity entity = _lifeManagerRepository.LoadEntity <RecurringTaskEntity>(id);

            if (entity == null)
            {
                return(null);
            }

            return(_recurringTaskMapper.ToDomain(entity));
        }
        public Principle GetById(long id)
        {
            PrincipleEntity entity = _lifeManagerRepository.LoadEntity <PrincipleEntity>(id);

            if (entity == null)
            {
                return(null);
            }

            return(_principleMapper.ToDomain(entity));
        }
        public Appointment GetById(long id)
        {
            AppointmentEntity entity = _lifeManagerRepository.LoadEntity <AppointmentEntity>(id);

            if (entity == null)
            {
                return(null);
            }

            return(_appointmentMapper.ToDomain(entity));
        }