Website may be up and down over next few months. I'm currently doing a complete overhaul of everything. Going back to simple individual .htm pages, new overall site theme, sanitizing and cleaning up html of all pages and blog posts, attempting to implement a new tooling and publishing system etc etc.

GAH! Google is such phail, Bing is no better either. Been trying to find out how to use EF + SqlCe without having to specify any settings in my web.config.

Finally I found this page on unit testing that pointed be in the right direction.

And here is how to do it in code!

    
    public class testModel
    {
        [Key]
        [Required]
        public int ID { get; set; }
        [Required]
        public int SomeID { get; set; }
    }

    public class MyClass : System.Data.Entity.DbContext
    {
        public MyClass() { }
        public MyClass(string filename) : base(filename) { }
        
        public DbSet TableTest { get; set; }
    }
   
    public class HomeController : Controller
    {

        public ActionResult Index()
        {
            var path = this.Context.Server.MapPath("~/bin/");
            Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0", path, "");
            Database.SetInitializer(new DropCreateDatabaseIfModelChanges());
            var tmp = new MyClass("test.sdf");
            tmp.TableTest.Add(new testModel() { SomeID = 5 });
            tmp.SaveChanges();

            return this.View(); 
        }
    }

XNA example code updates

Published 2/4/2007 by createdbyx in Example | News | XNA
Tags: , ,

I just purchased a wired xbox 360 controller so I can test my code using the controller! I also just posted updated code for my two xna example projects ...

The examples now support the xbox 360 controller as an input device.


The Fart Sniffer tutorial will walk you through creating a number of flies that will fallow a scent trail, that you draw on the screen using the mouse. It will be designed to show how easy it is to code AI to achieve simple path finding / fallowing "fly like" behavior.


I added 2 more simple XNA example projects to the xna page.


Created by: X

Just another personal website in this crazy online world

Name of author Dean Lunz (aka Created by: X)
Computer programming nerd, and tech geek.
About Me -- Resume