/// <summary> /// Updates the specified entity. /// </summary> /// <param name="entity">The entity.</param> /// <returns></returns> public Task <Response <TEntity> > Update(TEntity entity) { return(ApplicationUtil.Try(async() => { await this.service.Update(entity); return entity; })); }
/// <summary> /// Deletes the specified identifier. /// </summary> /// <param name="id">The identifier.</param> /// <returns></returns> public Task <Response <TEntity> > Delete(TId id) { return(ApplicationUtil.Try <TEntity>(async() => { await this.service.Delete(id); return null; })); }
/// <summary> /// Gets all. /// </summary> /// <param name="pageIndex">The page.</param> /// <param name="pageSize">The items per page.</param> /// <param name="sortBy">The sort by.</param> /// <param name="direction">The direction.</param> /// <returns></returns> public Task <Response <Paginated <TEntity> > > GetAll(int pageIndex, int pageSize, string sortBy, string direction) { return(ApplicationUtil.Try(() => this.service.GetAll(pageIndex, pageSize, sortBy, direction))); }
/// <summary> /// Gets all. /// </summary> /// <returns></returns> public Task <Response <IEnumerable <TEntity> > > GetAll() { return(ApplicationUtil.Try(() => this.service.GetAll())); }
/// <summary> /// Gets the specified identifier. /// </summary> /// <param name="id">The identifier.</param> /// <returns></returns> public Task <Response <TEntity> > Get(TId id) { return(ApplicationUtil.Try(() => this.service.Get(id))); }