示例#1
0
        internal static void Initialize(WebMailContext context)
        {
            context.Database.EnsureCreated();

            if (context.Mail.Any())
            {
                return;
            }

            context.Mail.AddRange(
                new Mail
            {
                Title = "Hello world"
            },
                new Mail
            {
                Title = "Re: Hello world"
            }
                );

            context.SaveChanges();
        }
 public MailsController(WebMailContext context)
 {
     _context = context;
 }