Merry Christmas! You can tell you love something if you do it while on vacation and holidays, so let's jump right into it.
I recently converted the data access layer of Six Minutes To Release to LINQ to Entities. Aside from a bit of syntactical change, the conversion was painless. That is, until I got into the runtime:
Only parameterless constructors and initializers are supported in LINQ to Entities.
Fair enough. What I like to do is to create a class that I can quickly dump the results of a LINQ to SQL query into. Typically I'll use this for ListViews. For example:
ListView1.DataSource = (From t In db.table Select New DataClass(t, t.otherTable.Value, t.otherTable.Value2))
The problem is not that LINQ can't do this, it's specifically LINQ to Entities. So what you need to do instead is a 2-step process. First, take the data out of LINQ to Entities. Then, deal with the data in LINQ. How do you do this? By using .ToList() to process the query in LINQ to Entities and using a second query to get it into the class.
Dim query = (From t in db.table Select New With {.Table = t, .Value = t.otherTable.Value, .Value2 = t.otherTable.Value2})
ListView1.DataSource = (From q in query Select New DataClass(q.Table, q.Value, q.Value2))
Ideally, I'd like to get all this stuff out of ASP.Net and use jQuery templates instead, but that would be more legacy code converting than I have time for these days. So for now, this will be the solution I use.
This is my blog where I give my thoughts and opinions on various topics and share my creative endeavors with the world. I run two personal blogs, but combine them here for ease of access.
Blogger - My oldest blog using the Blogger platform contains posts full of opinions, gaming, and code.
Tumblr - Tumblr posts are all about my creative side, containing music, videos, writings, and updates on my web creations.
You can select a category below to view the latest post, or browse thorugh the posts using the navigation found at the top and bottom of each post.
Yeah, it's season 11. But the OTL Season 6 highlight reel is up, this time Fireball has taken the reins! Check out this video jam packed full of kills, deaths, silliness, and Sirius puns. https://www.youtube.com/watch?v=SXstLVjnaGo
Bing is so bad. https://otl.gg is being blocked in their search results, and Bing webmaster tools are absolutely useless, not telling me why it's being blocked.
Does anyone know of some way to get a human to look at this and see what's wrong with it? #bing#microsoft
Me and my wife, despite buying a house of nice size, always seem to get in each other's way, be it in the kitchen, on the stairs, it doesn't matter. She's all up in my two square feet.
I often joke that all I want for Christmas is my two square feet.
I got the honor and privilege of calling the NES Tetris NTSC world record today while running Classic Tetris Wars on my Twitch channel for the very first time. It was thrilling. Congratulations to Blue Scuti for his 6,609,220 level 153 performance. https://clips.twitch.tv/DiligentDeadGoldfishDoritosChip-cx_vDMWAjKaZUK6N
Six Degrees of Sunday, my 6DoF long play Twitch series, is getting revived for 2024. Plus, I will be producing Six'd Off, a companion YouTube series showcasing each game.
@shanselman Speaking of Overload, here's something you may be interested in... recently, some community members released "Overload First Strike", a single player Overload campaign that is a complete remake of the original Descent First Strike campaign.
It can work with just the original game, but it works best with "olmod" as it takes advantage of some of the features it provides: https://olmod.overloadmaps.com