FortuneService.cs 591 B

123456789101112131415161718192021222324
  1. using EasyRpc.Abstractions.Path;
  2. using EasyRpc.AspNetCore.Views;
  3. using Benchmarks.Data;
  4. using System.Threading.Tasks;
  5. using System.Collections.Generic;
  6. using EasyRpc.Abstractions.Services;
  7. namespace Benchmarks
  8. {
  9. [SharedService]
  10. public class FortuneService
  11. {
  12. private IRawDb _rawDb;
  13. public FortuneService(IRawDb rawDb) => _rawDb = rawDb;
  14. [GetMethod("/Fortunes/Fortunes")]
  15. [ReturnView(ContentType = "text/html; charset=utf-8")]
  16. public Task<List<Fortune>> Fortunes()
  17. {
  18. return _rawDb.LoadFortunesRows();
  19. }
  20. }
  21. }