public IHttpActionResult Save(BlogTagModel item) { try { if (item != null) { BlogTagService.SaveOrUpdate(item); return(Ok(item)); } return(BadRequest("No se ha enviado información que almacenar.")); } catch (HibernateAdoException hibernateException) { if (hibernateException.InnerException is GenericADOException) { if (hibernateException.InnerException.InnerException is OracleException) { return(InternalServerError(hibernateException.InnerException.InnerException)); } return(InternalServerError(hibernateException.InnerException)); } return(InternalServerError(hibernateException)); } catch (Exception exception) { return(InternalServerError(exception)); } }
public int SaveOrUpdate(BlogTagModel entity) { if (entity.ID != 0) { var dbEntity = BlogTagRepository.Get(entity.ID); if (dbEntity != null) { BlogTagRepository.Update(dbEntity); return(dbEntity.ID); } throw new ArgumentException("Invalid id"); } return(BlogTagRepository.Save(entity)); }
/// <summary> /// /// </summary> /// <param name="entity"></param> public void Update(BlogTagModel entity) { CurrentSession.Update(entity); }
/// <summary> /// /// </summary> /// <param name="entity"></param> /// <returns></returns> public int Save(BlogTagModel entity) { return((int)CurrentSession.Save(entity)); }
/// <summary> /// /// </summary> /// <param name="entity"></param> /// <returns></returns> public int Save(BlogTagModel entity) { return (int) CurrentSession.Save(entity); }
public int SaveOrUpdate(BlogTagModel entity) { if (entity.ID != 0) { var dbEntity = BlogTagRepository.Get(entity.ID); if (dbEntity != null) { BlogTagRepository.Update(dbEntity); return dbEntity.ID; } throw new ArgumentException("Invalid id"); } return BlogTagRepository.Save(entity); }
public void Update(BlogTagModel entity) { BlogTagRepository.Update(entity); }
public int Save(BlogTagModel entity) { return BlogTagRepository.Save(entity); }
public IHttpActionResult Save(BlogTagModel item) { try { if (item != null) { BlogTagService.SaveOrUpdate(item); return Ok(item); } return BadRequest("No se ha enviado información que almacenar."); } catch (HibernateAdoException hibernateException) { if (hibernateException.InnerException is GenericADOException) { if (hibernateException.InnerException.InnerException is OracleException) { return InternalServerError(hibernateException.InnerException.InnerException); } return InternalServerError(hibernateException.InnerException); } return InternalServerError(hibernateException); } catch (Exception exception) { return InternalServerError(exception); } }
public int Save(BlogTagModel entity) { return(BlogTagRepository.Save(entity)); }