I have this model:
I use this code to add object to my database:
using (var c = new MyContext())
{
var con = new SunCondition()
{
TimeOffset = new TimeSpan(12, 2, 3),
Name = "me",
IsAfter = true,
IsRise = true
};
c.ConditionSet.AddObject(con);
c.SaveChanges();
}
but it not adds any thing to database.
This code have no problem.
I should say that always changes which program do on mdf file was on file that automatically copied to bin/debug or bin/release folder; so when I check my mdf file that is reachable in Visual Studio, it does not have any changes affected by application.