Beispiel #1
0
        static void AddData()
        {
            using (var pgdb = new NpgsqlDbContext())
            {
                var students = new[] {
                    new Student
                    {
                        Name = "Lee",
                        Code = "125"
                    },
                    new Student
                    {
                        Name = "Mao",
                        Code = "777"
                    },
                    new Student
                    {
                        Name = "Liu",
                        Code = "345"
                    }
                };


                pgdb.Students.AddRange(students);

                pgdb.SaveChanges();
            }
        }
Beispiel #2
0
 static void QueryData()
 {
     using (var pgdb = new NpgsqlDbContext())
     {
         var nameClause = $"%L%";
         var students   = pgdb.Students.Where(c => DbFunctions.Like(c.Name, nameClause)).ToList();
         if (students.Any())
         {
             Console.WriteLine("get data success");
         }
     }
 }
Beispiel #3
0
 public AccountController(UserManager <ApplicationUser> userManager,
                          SignInManager <ApplicationUser> signInManager,
                          ApplicationRoleManager roleManager,
                          NpgsqlDbContext dbContext,
                          IConfiguration configuration,
                          IUnitOfWork unitOfWork,
                          IEmailSender emailSender)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _roleManager   = roleManager;
     _dbContext     = dbContext;
     _configuration = configuration;
     _emailSender   = emailSender;
     _unitOfWork    = unitOfWork;
 }
Beispiel #4
0
 public NpsqlCalendarEventRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
Beispiel #5
0
 public NpsqlAttachedFileRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
 public NpsqlPositionRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
 public NpsqlCompanyRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
 public NpsqlCompanyNotificationRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
 public NpsqlChatMessageParticipantRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
 public NpsqlRegistrationRequestRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
 public NpsqlDepartmentRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
Beispiel #12
0
 public NpsqlShortLinkRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
 public NpsqlPrivateNotificationRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
 public NpsqlTaskNotificationRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
Beispiel #15
0
 public NpsqlUnitOfWork(NpgsqlDbContext context)
 {
     _context = context;
 }
Beispiel #16
0
 public NpsqlTaskRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
 public NpsqlEmployeeInvitationRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
Beispiel #18
0
 public NpsqlChatRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
 public NpsqlApplicationUserRepository(NpgsqlDbContext context)
 {
     _context = context;
 }
Beispiel #20
0
 public NpsqlFilePublickLinkRepository(NpgsqlDbContext context)
 {
     _context = context;
 }