コード例 #1
0
        /// <summary>
        ///     Find app paths settings.
        /// </summary>
        /// <returns></returns>
        private static AppPathModel FindAppPathSettings()
        {
            var appPath = new AppPathModel(HostingEnvironment.MapPath("~/"));

            appPath.ProfileImage       = ConfigurationManager.AppSettings[$"Path.{nameof(appPath.ProfileImage)}"];
            appPath.SkillCategoryImage = ConfigurationManager.AppSettings[$"Path.{nameof(appPath.SkillCategoryImage)}"];

            if (string.IsNullOrWhiteSpace(appPath.ProfileImage))
            {
                throw new Exception($"Invalid {nameof(appPath.ProfileImage)} setting");
            }

            var absoluteProfileImagePath = HostingEnvironment.MapPath(appPath.ProfileImage);

            if (!string.IsNullOrWhiteSpace(absoluteProfileImagePath) && !Directory.Exists(absoluteProfileImagePath))
            {
                Directory.CreateDirectory(absoluteProfileImagePath);
            }

            var absoluteSkillCategoryImagePath = HostingEnvironment.MapPath(appPath.SkillCategoryImage);

            if (!string.IsNullOrWhiteSpace(absoluteSkillCategoryImagePath) &&
                !Directory.Exists(absoluteSkillCategoryImagePath))
            {
                Directory.CreateDirectory(absoluteSkillCategoryImagePath);
            }

            return(appPath);
        }
コード例 #2
0
 /// <summary>
 ///     Initialize controller with injectors.
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="dbService"></param>
 /// <param name="mapper"></param>
 /// <param name="fileService"></param>
 /// <param name="appPath"></param>
 public ApiSkillCategoryController(IUnitOfWork unitOfWork, IDbService dbService, IMapper mapper, IFileService fileService, AppPathModel appPath)
 {
     _unitOfWork  = unitOfWork;
     _dbService   = dbService;
     _mapper      = mapper;
     _fileService = fileService;
     _appPath     = appPath;
 }
コード例 #3
0
 public SkillCategoryService(IDbService dbService, IMapper mapper, IFileService fileService, AppPathModel appPath, IUnitOfWork unitOfWork, HttpRequestMessage httpRequestMessage, UrlHelper urlHelper)
 {
     _dbService          = dbService;
     _mapper             = mapper;
     _appPath            = appPath;
     _unitOfWork         = unitOfWork;
     _httpRequestMessage = httpRequestMessage;
     _urlHelper          = urlHelper;
 }
コード例 #4
0
 /// <summary>
 /// Initialize service with injectors.
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="profileCacheService"></param>
 /// <param name="profileService"></param>
 /// <param name="mapper"></param>
 /// <param name="dbService"></param>
 /// <param name="fileService"></param>
 /// <param name="appPath"></param>
 public UserService(IUnitOfWork unitOfWork,
                    IValueCacheService <string, ProfileModel> profileCacheService,
                    IProfileService profileService, IMapper mapper,
                    UrlHelper urlHelper,
                    IDbService dbService,
                    IFileService fileService, AppPathModel appPath)
 {
     _unitOfWork          = unitOfWork;
     _profileCacheService = profileCacheService;
     _profileService      = profileService;
     _mapper      = mapper;
     _dbService   = dbService;
     _fileService = fileService;
     _urlHelper   = urlHelper;
     _appPath     = appPath;
 }
コード例 #5
0
ファイル: FileService.cs プロジェクト: redplane/cv-management
 /// <summary>
 /// Initialize service with injectors.
 /// </summary>
 /// <param name="appPath"></param>
 public FileService(AppPathModel appPath)
 {
     _appPath = appPath;
 }