static void Main(string[] args) { using (var context = new BPDbContext()) { context.Database.Initialize(force: true); Console.WriteLine("Database initializer done! Press any key to continue..."); Console.ReadKey(); } }
public ActionResult Index() { BPDbContext db = new BPDbContext(); var blogs = db.Blogs.OrderByDescending(b => b.BlogsId).ToList(); List <PushModel> push = new List <PushModel>(); if (blogs.Count() < 4) { foreach (var item in blogs) { PushModel pm = new PushModel { blog = item }; if (item.Context.Count() > 220) { pm.shortcontext = item.Context.Substring(0, 220) + "..."; } else { pm.shortcontext = item.Context; } push.Add(pm); } } else { for (int i = 0; i < 4; i++) { var item = blogs[i]; PushModel pm = new PushModel { blog = item }; if (item.Context.Count() > 220) { pm.shortcontext = item.Context.Substring(0, 220) + "..."; } else { pm.shortcontext = item.Context; } push.Add(pm); } } return(View(push)); }
public BidRepository() { db = new BPDbContext(); }
public ArtworkRepository() { db = new BPDbContext(); }
public UserRepository() { db = new BPDbContext(); }
public ArtistRepository() { db = new BPDbContext(); }
public CategoryRepository() { db = new BPDbContext(); }
public AuctionRepository() { db = new BPDbContext(); }