Ejemplo n.º 1
0
 public UserService()
 {
     UserActionService = new UserActionService();
     UserRepository    = new UserRepository();
     AMapper           = new AMapper();
     HashHelper        = new HashHelper(StaticSalt.Salt);
 }
Ejemplo n.º 2
0
 public UserController(IUserService userService, IValidationService valService)
 {
     UserService       = userService;
     ValidationService = valService;
     AMapper           = new AMapper();
 }
Ejemplo n.º 3
0
 public EmployeesController(IEmployeeService service)
 {
     employeeService = service;
     aMapper         = new AMapper();
 }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            try
            {
                Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

                ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
                configurationBuilder.AddUserSecrets <Program>();
                configurationBuilder.AddJsonFile(Path.Combine(Directory.GetCurrentDirectory(), "appsettings.json"));

                IConfigurationRoot configuration = configurationBuilder.Build();

                DbContextOptionsBuilder <MedicContext> builder = new DbContextOptionsBuilder <MedicContext>();
                builder.UseSqlServer(configuration[Constants.ConnectionString]);
                builder.EnableSensitiveDataLogging();

                using MedicContext context = new MedicContext(builder.Options);
                IMedicContextSeeder medicContextSeeder = new MedicContextSeeder(context);
                medicContextSeeder.Seed();

                AMapperConfiguration mapConfiguration = new AMapperConfiguration();
                IMappable            mapper           = new AMapper(mapConfiguration.CreateConfiguration());

                string cpDirectory, clprDirectory;
                bool   doesCpDirectoryExist = true, doesCLPRDirectoryExist = true;

                while (true)
                {
                    consoleWriter.Notify("Enter directory for CP files");
                    cpDirectory = consoleReader.Read();
                    consoleWriter.Notify("Enter directory for CLPR files");
                    clprDirectory = consoleReader.Read();

                    if (!string.IsNullOrWhiteSpace(cpDirectory))
                    {
                        doesCpDirectoryExist = Directory.Exists(cpDirectory);
                    }

                    if (!string.IsNullOrWhiteSpace(clprDirectory))
                    {
                        doesCLPRDirectoryExist = Directory.Exists(clprDirectory);
                    }

                    if (doesCpDirectoryExist && doesCLPRDirectoryExist)
                    {
                        break;
                    }
                    else
                    {
                        if (!doesCpDirectoryExist)
                        {
                            consoleWriter.Notify("CP directory does not exist.");
                        }

                        if (!doesCLPRDirectoryExist)
                        {
                            consoleWriter.Notify("CLPR directory does not exist.");
                        }
                    }

                    doesCpDirectoryExist   = true;
                    doesCLPRDirectoryExist = true;
                }

                if (!string.IsNullOrWhiteSpace(cpDirectory))
                {
                    ReadCpFiles(mapper, builder, cpDirectory);
                }

                if (!string.IsNullOrWhiteSpace(clprDirectory))
                {
                    ReadCLPRFiles(mapper, builder, clprDirectory);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            consoleWriter.Notify("Press any key to exit.");
            Console.ReadKey();
        }
 public UserActionService()
 {
     UserActionRepository = new UserActionRepository();
     AMapper = new AMapper();
 }
Ejemplo n.º 6
0
 public CandidatesController(ICandidateService service)
 {
     candidateService = service;
     aMapper          = new AMapper();
 }
 public UserActionController(IUserActionService userActionService)
 {
     UserActionService = userActionService;
     AMapper           = new AMapper();
 }
 public CandidateService()
 {
     CandidateRepository = new CandidateRepository();
     AMapper             = new AMapper();
 }
 public EmployeeService()
 {
     EmployeeRepository = new EmployeeRepository();
     AMapper            = new AMapper();
 }