SHARE
TWEET

Untitled

a guest Jun 25th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [HttpGet("{id}")]
  2. public async Task<ActionResult<T>> Get(int id)
  3. {
  4.     return this.repository.Find(x => x.Id == id);
  5. }
  6.      
  7. public virtual async Task<TEntity> Find(Func<TEntity,bool> predicate)
  8. {
  9.     return await Task.Run(()=> context.Set<TEntity>().FirstOrDefault(predicate));
  10. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top