public Album Update(Album album) { using (var svc = new ServiceProxyHelper<IAlbumService>("AlbumService")) { return svc.Proxy.Update(album); } }
public Album Update(Album album, string authenticationToken) { using (var svc = new HttpClientHelper()) { var result = JsonHelper.DeserializeJson<Album>(svc.Put(Constants.BlogRestUrl, "album", album, authenticationToken)); return result; } }
public Album Add(Album album) { try { var checkAlbum = IsAlbumNameInUse(album.AlbumName, album.User.Id); if (checkAlbum) { return new Album().GenerateError<Album>((int)Constants.Error.ValidationError, string.Format("Album name {0} is already in use.", album.AlbumName)); } return AlbumMapper.ToDto(_albumRepository.Add(AlbumMapper.ToEntity(album))); } catch (Exception ex) { throw new BlogException(ex.Message, ex.InnerException); } }
public IHttpActionResult GetUserDefault(int userId) { try { var result = _service.GetUserDefaultGroup(userId); return Ok(result); } catch (Exception ex) { _errorSignaler.SignalFromCurrentContext(ex); var errorResult = new Album().GenerateError<Album>((int)Constants.Error.InternalError, "Server technical error"); return Ok(errorResult); } }
public IHttpActionResult Put([FromBody]Album album) { try { if (!ModelState.IsValid) { return BadRequest(ModelState); } var result = _service.Update(album); return Ok(result); } catch (Exception ex) { _errorSignaler.SignalFromCurrentContext(ex); var errorResult = new Album().GenerateError<Album>((int)Constants.Error.InternalError, "Server technical error"); return Ok(errorResult); } }
public Album Update(Album album) { return _albumLogic.Update(album); }
public Album Add(Album album) { return _albumLogic.Add(album); }