Guest User

Untitled

a guest
Jun 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. public List<BlobDetails> GetAllBlobsNames()
  2. {
  3. RichTekstModelDataContext dc = new RichTekstModelDataContext();
  4.  
  5. var allBlobs = from b in dc.Blobs
  6. orderby b.RowVersion descending
  7. select new {b.Id, b.Size, b.Signature, b.RowVersion};
  8.  
  9. ---> allBlobs.ToList<BlobDetails>();
  10. }
  11.  
  12. public class BlobDetails
  13. {
  14. public int Id { get; set; }
  15. public string Signature { get; set; }
  16. public int Size { get; set; }
  17. public System.Data.Linq.Binary RowVersion { get; set; }
  18. }
  19.  
  20. var qry = from b in dc.Blobs
  21. orderby b.RowVersion descending
  22. select new BlobDetails {
  23. Id = b.Id, Size = b.Size,
  24. Signature = b.Signature, RowVersion = b.RowVersion};
  25.  
  26. return qry.ToList();
  27.  
  28. var qry = from b in dc.Blobs
  29. orderby b.RowVersion descending
  30. select new {b.Id, b.Size, b.Signature, b.RowVersion};
  31.  
  32. var typedQry = from b in qry.AsEnumerable()
  33. select new BlobDetails {
  34. Id = b.Id, Size = b.Size,
  35. Signature = b.Signature, RowVersion = b.RowVersion};
  36. return typedQry.ToList();
  37.  
  38. var allBlobs = from b in dc.Blobs
  39. orderby b.RowVersion descending
  40. select new BlobDetails {Id = b.Id, .... };
  41. allBlobs.ToList();
Add Comment
Please, Sign In to add comment