示例#1
0
        public ValidationResult Create(FriendViewModel game)
        {
            var friendEntity = _mapper.Map <Friend>(game);

            _friendValidation.BaseValidation();
            var validation = _friendValidation.Validate(friendEntity);

            if (validation.IsValid)
            {
                _friendRepository.BeginTransaction();
                _friendRepository.Create(friendEntity);
                _friendRepository.Commit();
            }

            return(validation);
        }