public PersonsService(PersonContext context, IFileSignature fileSignatureService, ProfileImageSetting profileImageSetting, SecureRootSetting secureRootSetting) { _context = context; _fileSignatureService = fileSignatureService; _profileImageSetting = profileImageSetting; _filesPath = secureRootSetting.Path; }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var secureRootSetting = new SecureRootSetting { Path = Path.Combine(Directory.GetCurrentDirectory(), "SecureRoot") }; services.AddDatabase(Configuration, _env.IsDevelopment()) .AddScoped <IPersons, PersonsService> () .AddSingleton <IFileSignature> (new InMemoryService("Data.json")) .AddSingleton(secureRootSetting) .AddControllersWithViews(); Configuration.AddConfig <ProfileImageSetting> (services) .ThrowExceptionOnFail(); }
public DownloadController(SecureRootSetting secureRootSetting) { _filesPath = secureRootSetting.Path; }