コード例 #1
0
        public StrongPoint Update(ChangeStrongPointCommand command)
        {
            var StrongPoint = _repository.GetOne(command.Id);

            if (!string.IsNullOrEmpty(command.Name))
            {
                StrongPoint.ChangeName(command.Name);
            }
            if (!string.IsNullOrEmpty(command.Description))
            {
                StrongPoint.ChangeDescription(command.Description);
            }

            StrongPoint.ChangeClass(command.Class);

            _repository.Update(StrongPoint);

            if (Commit())
            {
                return(StrongPoint);
            }

            return(null);
        }
コード例 #2
0
        public StrongPoint Update(ChangeStrongPointCommand command)
        {
            var StrongPoint = _repository.GetOne(command.Id);
            if(!string.IsNullOrEmpty(command.Name))
                StrongPoint.ChangeName(command.Name);
            if (!string.IsNullOrEmpty(command.Description))
                StrongPoint.ChangeDescription(command.Description);

                StrongPoint.ChangeClass(command.Class);

            _repository.Update(StrongPoint);

            if (Commit())
                return StrongPoint;

            return null;
        }