Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7495693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:16:22+00:00 2026-05-29T18:16:22+00:00

My models for my blog : namespace AlexPeta_2.Models { public class Article { public

  • 0

My models for my blog :

namespace AlexPeta_2.Models
{
    public class Article
    {
        public int ArticleId { get; set; }
        public string Title { get; set; }
        public string Text { get; set; }
        public char Published { get; set; }
        public DateTime CreatedDate { get; set; }
        public char AllowComment { get; set; }

        public virtual ICollection<Tag> Tags { get; set; }
        public virtual ICollection<Comment> Comments { get; set; }
    }
}

namespace AlexPeta_2.Models
{
    public class Comment
    {
        public int CommentId { get; set; }
        public string Name { get; set; }
        public string Email { get; set; }
        public string HomePage { get; set; }
        public string Comm { get; set; }
        public DateTime CreatedDate { get; set; }
    }
}

namespace AlexPeta_2.Models
{
    public class Tag
    {
        public int TagId { get; set; }
        public string TagName { get; set; }
        public virtual ICollection<Article> Articles { get; set; }
    }
}

here are my dbsets:

public class BlogContext : DbContext
{
    public DbSet<Article> Articles { get; set; }
    public DbSet<Tag> Tags { get; set; }
    public DbSet<Comment> Comments { get; set; }
}

here is my initializer :

public class BlogInitializer : DropCreateDatabaseIfModelChanges<BlogContext>
    {
        protected override void Seed(BlogContext context)
        {

            List<Tag> tags = new List<Tag>
            {
                new Tag { TagId = 1, TagName = "Javascript" },
                new Tag { TagId = 2, TagName = "Bodybuilding" },
                new Tag { TagId = 3, TagName = "Uncategorised" },
                new Tag { TagId = 4, TagName = "CSS" },
                new Tag { TagId = 5, TagName = "HTML/XHTML" },
                new Tag { TagId = 6, TagName = "APEX" },
                new Tag { TagId = 7, TagName = "PL/SQL" },
                new Tag { TagId = 8, TagName = "Personal" },
                new Tag { TagId = 9, TagName = "ASP" },
                new Tag { TagId = 10, TagName = "MVC" },
                new Tag { TagId = 11, TagName = "C#" },
                new Tag { TagId = 12, TagName = "Snowboarding" }
            };
            tags.ForEach(t => context.Tags.Add(t));
            context.SaveChanges();
        }
    }

The funny thing is : i ran the application with no Connection String in webconfig, it runs fine , i see all my tags in the controller but there is not Database file in APP_DATA ?? How come is that? or what happened?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:16:26+00:00Added an answer on May 29, 2026 at 6:16 pm

    If you do not provide a connection string, EF Code First creates the database with user credentials (windows) on the local SQLExpress instance. You can validate the same by using SQL Server Management Studio Express and logging on to the local instance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this simple Blog model: class Blog(models.Model): title = models.CharField(_('title'), max_length=60, blank=True, null=True)
I'm trying to implement a simple blog, which contains topics models/Topic.cs public class Topic
class Tag(models.Model): name = models.CharField(maxlength=100) class Blog(models.Model): name = models.CharField(maxlength=100) tags = models.ManyToManyField(Tag) Simple
I'm working on a blog application in Django. Naturally, I have models set up
class Blog(models.Model): name = models.CharField() def get_posts_belonging_to_this_blog_instance(self): return Post.objects.filter(blog__exact=self.id) class Category(models.Model): name = models.CharField()
I have this model: class blog(models.Model): user = models.ForeignKey(User) mail = models.EmailField(max_length=60, null=False, blank=False)
I have a Blog model, a Post model and a Comment model: class Blog(models.Model):
Given the following models: class Blog(models.Model): name = models.CharField() class Entry(models.Model): blog = models.ForeignKey(Blog)
Given the following models class Blog(models.Model): followers = models.ManyToManyField(User, through='Follow') class Follow(models.Model): blog =
If I have two models in Django: class Blog(models.Model): author = models.CharField() class Post(models.Model):

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.