예제 #1
0
        public async Task <bool> CreatePhoneItemAsync(PhoneViewModel phoneToCreate)
        {
            try
            {
                var phone = _mapper.Map <PhoneViewModel, Phone>(phoneToCreate);
                await _repository.AddAsync(phone);

                await _repository.CommitAsync();

                phoneToCreate.Id = phone.Id;
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }