Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public IQueryable getTicketInformation(int ticketID)
- {
- var ticketDetails = from tickets in _context.tickets
- join file in _context.file_objects on tickets.ticket_id equals file.source_id
- where tickets.ticket_id == ticketID
- select new { tickets.ticket_id, tickets.title, tickets.care_of_email, file.filename };
- return ticketDetails.AsQueryable();
- }
- public IQueryable<myObject> getTicketInformation(int ticketID)
- {
- var ticketDetails = from tickets in _context.tickets
- join file in _context.file_objects on tickets.ticket_id equals file.source_id
- where tickets.ticket_id == ticketID
- select new { tickets.ticket_id, tickets.title, tickets.care_of_email, file.filename };
- return ticketDetails.AsQueryable()<myObject>;
- }
- public myObject getTicketInformation(int ticketID)
- {
- ....linq statement....
- myObject o = null;
- foreach (obj in linqstatemt)
- {
- o = new myObject();
- o.ticket_id = obj.ticket_id
- .......
- }
- return o;
- }
- select new MyObject { TicketId = tickets.ticket_id,
- Title = tickets.title, ...};
- select new MyObject(tickets.ticket_id, tickets.title);
- return ticketDetails.AsQueryable()<myObject>;
- return ticketDetails.AsQueryable<myObject>();
- public IQueryable<myObject> getTicketInformation(int ticketID)
- {
- return from tickets in _context.tickets
- join file in _context.file_objects on tickets.ticket_id equals file.source_id
- where tickets.ticket_id == ticketID
- select new myObject() {
- ticket_id = tickets.ticket_id,
- title = tickets.title,
- care_of_email = tickets.care_of_email,
- filename = file.filename
- };
- }
Add Comment
Please, Sign In to add comment