I am learning Entity Framework. I created a demo app using Entity framework code first approach (without specifying any connection string).
static void Main(string[] args)
{
CreateBlog();
}
private static void CreateBlog()
{
var ObjBlog = new Blog
{
BloggerName = "Rasmita",
Title = "EntityFramework"
};
var Ctx = new Context();
Ctx.Blogs.Add(ObjBlog);
Ctx.SaveChanges();
}
The console App is running fine, It created data base, I am able to fetch data from it. But, I am unable to see it physically. I mean I want to know where it got created? in Local Sql server or Visual studio local db???
App.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
Context class
using System.Data.Entity;
using BlogsApp;
namespace DataLayer
{
public class Context:DbContext
{
public DbSet<Blog> Blogs { get; set; }
public DbSet<Post> Posts { get; set; }
}
}
I am using EntityFramework 6.1.1, .Net Framework 4.5, Visual studio 2012. I have SqlServer 2012 installed on my machine. Please help me in finding the Db