public TResponse GetSingle <TEntity, TResponse>(int id) where TEntity : class where TResponse : class { var db = _context.Find <TEntity>(id); if (db == null) { throw new HttpStatusCodeException(HttpStatusCode.NotFound, _localizer["Some bug"]); } return(Mapper.Map(db).ToANew <TResponse>()); }