public async Task <ICollection <Company> > GetAll(int pageNumber, int pageSize) => await _context.Companies .Where(CompanyQuery.GetAll()) .Skip((pageNumber - 1) * pageSize) .Take(pageSize) .AsNoTracking() .ToListAsync();
public UnitOfWork(JobDbContext context, Repository <Company> companyRepository, Repository <JobApplicationAnswer> jobApplicationAnswerRepository, Repository <JobApplication> jobApplicationRepository, Repository <JobOfferQuestion> jobOfferQuestionRepository, Repository <JobOffer> jobOfferRepository, Repository <JobSeeker> jobSeekerRepository, Repository <User> userRepository, UserQuery userQuery, JobOfferQuery jobOfferQuery, CompanyQuery companyQuery, JobApplicationQuery jobApplicationQuery) { this.context = context; CompanyRepository = companyRepository; JobApplicationAnswerRepository = jobApplicationAnswerRepository; JobApplicationRepository = jobApplicationRepository; JobOfferQuestionRepository = jobOfferQuestionRepository; JobOfferRepository = jobOfferRepository; JobSeekerRepository = jobSeekerRepository; UserRepository = userRepository; UserQuery = userQuery; JobOfferQuery = jobOfferQuery; CompanyQuery = companyQuery; JobApplicationQuery = jobApplicationQuery; }
public void TestMethod3() { var svc_userid = Environment.GetEnvironmentVariable("BCREG_SERVICE_ACCT"); var company = CompanyQuery.ProcessCompanyQuery(svc_userid, "bad_passwd", "https://twmgateway.gov.bc.ca/rest/ltsa/v1/corporations/0410721").Result; Assert.IsNull(company); }
// for tests public UnitOfWork(DbContextOptions <JobDbContext> contextOptions) { context = new JobDbContext(contextOptions); CompanyRepository = new Repository <Company>(context); JobApplicationAnswerRepository = new Repository <JobApplicationAnswer>(context); JobApplicationRepository = new Repository <JobApplication>(context); JobOfferQuestionRepository = new Repository <JobOfferQuestion>(context); JobOfferRepository = new Repository <JobOffer>(context); JobSeekerRepository = new Repository <JobSeeker>(context); UserRepository = new Repository <User>(context); UserQuery = new UserQuery(context); JobOfferQuery = new JobOfferQuery(context); CompanyQuery = new CompanyQuery(context); JobApplicationQuery = new JobApplicationQuery(context); }
public int PartialUpdate([FromRoute] string id, [FromBody] JsonMergePatchDocument <Company> patch) { Guid docId = new Guid(id); var ops = new List <string>(); patch.Operations.ForEach(op => { ops.Add(op.path.TrimStart('/')); }); var data = new Company(); patch.ApplyTo(data); var query = new CompanyQuery(); return(query.PartialUpdate(docId, data, ops)); }
public void TestMethod1() { var svc_userid = Environment.GetEnvironmentVariable("BCREG_SERVICE_ACCT"); var svc_passwd = Environment.GetEnvironmentVariable("BCREG_SERVICE_PASSWD"); var company = CompanyQuery.ProcessCompanyQuery(svc_userid, svc_passwd, "https://twmgateway.gov.bc.ca/rest/ltsa/v1/corporations/0410721").Result; Assert.IsNotNull(company); Assert.AreEqual(company.name, "A-ZANON'S GARDENING & LANDSCAPING LTD."); Assert.AreEqual(company.number, "0410721"); Assert.AreEqual(company.corporationType, "BC"); Assert.AreEqual(company.corporationClass, "BC"); Assert.IsNull(company.bn9); Assert.IsNull(company.bn15); Assert.AreEqual(company.jurisdiction, "BC"); Assert.AreEqual(company.stateCode, "LRS"); Assert.AreEqual(company.stateActive, "true"); Assert.AreEqual(company.stateDescription, "IN LIM RESTORE"); }
public async Task <int> Count() => await _context.Companies.Where(CompanyQuery.GetAll()).CountAsync();
public async Task <int> CountMigration() => await _context.Companies.Where(CompanyQuery.GetAllMigrationsCompany()).CountAsync();
public async Task <Company> GetById(Guid id) => await _context.Companies.FirstOrDefaultAsync(CompanyQuery.FindById(id));
public async Task <Company> GetCompanyByCnpj(string cnpj) => await _context.Companies.FirstOrDefaultAsync(CompanyQuery.FindByCnpj(cnpj));
public async Task <Company> GetCompanyByEmail(string email) => await _context.Companies.FirstOrDefaultAsync(CompanyQuery.FindByEmail(email));
public void Insert([FromBody] Company data) { var cq = new CompanyQuery(); cq.Insert(data); }
public async Task <bool> ExistEmail(string email) => await _context.Companies.AsNoTracking().AnyAsync(CompanyQuery.FindByEmail(email));
public async Task <bool> ExistCpf(string cpf) => await _context.Companies.AsNoTracking().AnyAsync(CompanyQuery.FindByCpf(cpf));
public async Task <bool> ExistCnpj(string cnpj) => await _context.Companies.AsNoTracking().AnyAsync(CompanyQuery.FindByCnpj(cnpj));
public int Update([FromBody] Company data) { var cq = new CompanyQuery(); return(cq.Update(data)); }
public void InsertList([FromBody] List <Company> data) { var cq = new CompanyQuery(); cq.Insert(data); }
public Company Get([FromRoute] string id) { var query = new CompanyQuery(); return(query.GetSingle(new System.Guid(id))); }
public async Task <Company> GetCompanyByCpf(string cpf) => await _context.Companies.FirstOrDefaultAsync(CompanyQuery.FindByCpf(cpf));
public int Remove([FromBody] Company data) { var cq = new CompanyQuery(); return(cq.Remove(data)); }
public IEnumerable <Company> Page([FromBody] PageRequest pageDoc) { var query = new CompanyQuery(); return(query.GetPage(pageDoc.Page, pageDoc.PageSize, new System.DateTime())); }