Esempio n. 1
0
 /// <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;
     }));
 }
Esempio n. 2
0
 /// <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;
     }));
 }
Esempio n. 3
0
 /// <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)));
 }
Esempio n. 4
0
 /// <summary>
 /// Gets all.
 /// </summary>
 /// <returns></returns>
 public Task <Response <IEnumerable <TEntity> > > GetAll()
 {
     return(ApplicationUtil.Try(() => this.service.GetAll()));
 }
Esempio n. 5
0
 /// <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)));
 }