コード例 #1
0
        public static void Initialize(LaprTrackrContext context)
        {
            context.Database.EnsureCreated();
            if (context.Users.Any())
            {
                return;
            }

            context.Users.AddRange(new User()
            {
                Username      = "******",
                Password      = "******",
                Email         = "*****@*****.**",
                Role          = UserRoles.Admin,
                CreatedAt     = DateTime.Now,
                LastUpdatedAt = DateTime.Now
            });

            context.SaveChanges();
        }
コード例 #2
0
 public FoodService(LaprTrackrContext context)
 {
     _context = context;
 }
コード例 #3
0
 public UserService(LaprTrackrContext context)
 {
     _context = context;
 }
コード例 #4
0
 public EatsService(LaprTrackrContext context)
 {
     _context = context;
 }
コード例 #5
0
 public AuthService(IConfiguration config, LaprTrackrContext context)
 {
     _config  = config;
     _context = context;
 }