A Few MVC SQL Tips and Tricks

I have been working with Visual Studio 2015, MVC .NET and MS SQL lately, and ran into several things that I had to keep looking up over and over, so I thought there may be someone else out there in the same boat.

Note: These are all tips for working code-first in Visual Studio.

  1. In your Model, say you want to have a table’s Primary Key auto-increment. Sure you add [Key], but you also need to add this: [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    auto_increment
  2. Here is a handy snippet you need to add to Global.asax in order to add more than one controller to your project:
    Database.SetInitializer<YourProjectContext>(new DropCreateDatabaseIfModelChanges<YourProjectContext>());
    In my screenshot, the name of my project is IceCream. If you don’t know the name of your project context, it should just be the name of your project with “context” on the end. I know that’s pretty basic, but as a new coder, it sometimes throws me. Global.asax is located at the very bottom of your Solution Explorer.
    if_model_changes

Launch House Game Dev Meetup

I have made and sold art for years and still have a hard time (sometimes) calling myself an Artist. So I feel almost funny being at a game development meetup when I have never even tried to make a game. It isn’t “impostor syndrome” it’s just, I’m not sure if I am passionate about it. Not sure what I bring to the proverbial table. But I am here today, at the Shaker Launch House, with about 10 other people working on their own games. I don’t have a specific game idea to work on, but I brought art supplies and am working through some Unity 3D demos. In fact, I watched a lot of tutorials yesterday on beginning game development, and they said the important thing is to “start making a game out of what you can do” as opposed to “start with a great idea”. If you start with a great story to tell, and it is leagues out of your capacity to tell it, you will get stuck and quit. If you make a game that is just “two dots moving” (or..something), then you can actually finish a thing and then move on to the next one with one complete project under your belt (and experience).

My favorite games are ones with interesting characters and stories, and honestly, most of them are 2D not 3D. (In fact, I still like interactive fiction/text adventures.) But Unity does 2D as well. I should learn 3D since I sculpt and I’d like to see if I can print something in 3D. So many skills overlap!

I’ve always wanted to write and illustrate stories and books – art books? nature books? field guides? story books? I just love books. I did not really think about making games (I feel like all of my friends have always wanted to make games). I’m still not sure it is my platform, but I really want the experience of learning new things. And good games tell stories.

IMG_1158
Launch House Angel?