Beispiel #1
0
 static void Main(string[] args)
 {
     using (var db = new MyWalletDbContext()) {
         //Console.Write("Enter a name for a new Account: ");
         //var name = Console.ReadLine();
         //var blog = new Account { Name = name };
         //db.Accounts.Add(blog);
         //db.SaveChanges();
         var query = from b in db.Accounts
                     orderby b.Name
                     select b;
         Console.WriteLine("All accounts in the database:");
         foreach (var item in query)
         {
             Console.WriteLine(item.Name);
         }
         Console.WriteLine("Press any key to exit...");
         Console.ReadKey();
     }
 }
 public EntityFrameworkAuthRepository(MyWalletDbContext dbContext, IMapper mapper) : base(dbContext)
 {
     _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
Beispiel #3
0
 protected EntityFrameworkRepository(MyWalletDbContext dbContext)
 {
     DbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
 }
 public WalletRepository()
 {
     dbContext = MyWalletDbContext.Instance;
 }