public IEnumerable <GetPacketDto> GetAllPackets()
        {
            IQueryable <Packet> result = context.Packets
                                         .OrderBy(packet => packet.Id)
                                         .Include(packet => packet.PacketHistories);

            return(result.Select(packet => GetPacketDto.DtoFromModel(packet)));
        }
        public IEnumerable <GetPacketDto> GetAllPacketsGroupBySender()
        {
            //var result = context.Packets.Where(pk => pk.Sender == sender);
            //return result.Select(packet => GetPacketDto.DtoFromModel(packet));
            var result = context.Packets
                         .OrderBy(pk => pk.Sender);

            //.ToDictionary(x => x.Key, x => x);

            return(result.Select(packet => GetPacketDto.DtoFromModel(packet)));
        }
        public IEnumerable <GetPacketDto> GetAllPacketsFromSender(String sender)
        {
            var result = context.Packets.Where(pk => pk.Sender == sender);

            return(result.Select(packet => GetPacketDto.DtoFromModel(packet)));
        }