Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. internal async Task<AnimalDocument> GetAnimalDocument(int id)
  2. {
  3.  
  4. var data = await _context.GetAnimalDocumentAsync(id);
  5. var result = JsonConvert.DeserializeObject<AnimalDocument>(data);
  6.  
  7. return result;
  8. }
  9.  
  10. public SeriliazedFile GetFile(int id, int type)
  11. {
  12. var result = new SeriliazedFile();
  13. if (type == 1)
  14. {
  15. var data = _context.GetHumanFile(id);
  16. result.FileName = data.Result.DocumentName;
  17. result.FilePath = data.Result.DocumentLocation;
  18. result.FileSize = data.Result.FileSize.Value;
  19. }
  20. else if (type == 2)
  21. {
  22. var data = _context.GetAnimalDocument(id);
  23. result.FileName = data.Result.DocumentName;
  24. result.FilePath = data.Result.DocumentLocation;
  25. result.FileSize = data.Result.FileSize.Value;
  26.  
  27. }
  28. return result;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement