You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
codeplanner edited this page Dec 30, 2014
·
2 revisions
Make sure you have EntityFramework installed in the project where you are setting up the Ninject stuff
Code For Testing
//Create kernel
var kernel = new StandardKernel(new ServiceModule());
//Get Service
var personService = kernel.Get<IPersonService>();
//Create person
var p = new Person{Age=30, Name="Steve"};
//Save or update
var result = personService.SaveOrUpdate(p);
//Print result
Console.WriteLine("Valid {0}",result.IsValid);
//Get all people from the service
foreach (var person in personService.GetAll())
{
Console.WriteLine("Name {0}, Age {1}", person.Name, person.Age);
}
Console.ReadLine();
Output
Valid True
Name Steve, Age 30
The Database
Since we successfully stored and retrieved data we know that a database was created but where is it and how can I change it? The database is the next step...