Пример #1
0
        public void InsertDataAlbumTest()
        {
            InsertDataAlbumRequest request = new InsertDataAlbumRequest();

            request.Album = _albumValidData;
            InsertDataAlbumResponse response = _albumService.InsertDataAlbum(request);

            Assert.IsTrue(response.Messages.Count == 0, "Failed insert data");
        }
Пример #2
0
        public InsertDataAlbumResponse InsertDataAlbum(InsertDataAlbumRequest request)
        {
            InsertDataAlbumResponse response = new InsertDataAlbumResponse();

            try
            {
                using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions {
                    IsolationLevel = IsolationLevel.ReadCommitted
                }))
                {
                    _albumRepo.Add(request.Album);
                    transScope.Complete();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }

            return(response);
        }