public AdController(IConfiguration configuration, ILogger <AdController> logger, IAdService adService, IAdSearchService adSearchService, IJsonDataService jsonDataService) { _configuration = configuration; _logger = logger; _adService = adService; _jsonDataService = jsonDataService; _adSearchService = adSearchService; }
public AdSearchService(ILogger <AdService> logger, IMapper mapper, ICacheService cacheService, IRepository <Share.Models.Ad.Entities.Ad, AdDbContext> adRepository, IConfiguration configuration, IJsonDataService jsonDataService) { _configuration = configuration; _logger = logger; _mapper = mapper; _cacheService = cacheService; _adRepository = adRepository; _jsonDataService = jsonDataService; }
public AdService(ILogger <AdService> logger, IMapper mapper, ICacheService cacheService, IFileRead fileReadService, IGoogleStorage googleStorage, IRepository <Share.Models.Ad.Entities.Ad, AdDbContext> adRepository, IConfiguration configuration, IJsonDataService jsonDataService) { _configuration = configuration; _logger = logger; _mapper = mapper; _fileReadService = fileReadService; _cacheService = cacheService; _googleStorage = googleStorage; _adRepository = adRepository; _jsonDataService = jsonDataService; }
public CarsController(IJsonDataService service = null) { var dataProvider = ConfigurationManager.AppSettings["DataProvier"]; if (dataProvider.ToUpper() == DataProvier.JSON.ToString()) { var carRepository = RepositoryFactories.GetRepositoryFactory(dataProvider, service).CarRepository; _service = new CarSaleService(carRepository); } else { throw new Exception($"The data provide {dataProvider} has not been implemented"); } }
public UpdateServiceHelper(Joiner joiner, Grouper grouper, TimeService timeService, IJsonDataService tripService, IJsonDataService busStopService, IJsonDataService busLineService, IJsonDataService expeditionService, IJsonDataService stopInTripService, BusStopModelService busStopModelService, IDocumentStoreRepository documentStoreRepository) { _joiner = joiner; _grouper = grouper; _timeService = timeService; _tripService = tripService; _busStopService = busStopService; _busLineService = busLineService; _expeditionService = expeditionService; _stopInTripService = stopInTripService; _busStopModelService = busStopModelService; _documentStoreRepository = documentStoreRepository; }
public static IRepositoryFactory GetRepositoryFactory(string repositoryType, IJsonDataService dataService = null) { if (repositoryType.ToUpper() == "JSON" && dataService == null) { throw new Exception("Json repository requires a json data service."); } switch (repositoryType.ToUpper()) { case "JSON": return(new JsonRepository(dataService)); case "SQLSever": throw new NotImplementedException("SQL Server data access layer has not been implemented."); default: throw new Exception("Not Possible. Please check Data Provider"); } }
/// <summary> /// </summary> /// <param name="userManager"> /// </param> /// <param name="signInManager"> /// </param> /// <param name="emailSender"> /// </param> /// <param name="logger"> /// </param> /// <param name="iUnitOfWork"> /// </param> /// <param name="roleManager"> /// </param> /// <param name="iSysControllerSysActionService"> /// </param> /// <param name="iSysRoleSysControllerSysActionService"> /// </param> /// <param name="iSysHelpService"> /// </param> /// <param name="schemeProvider"> /// </param> /// <param name="cache"> /// </param> /// <param name="jsonDataService"> /// </param> /// <param name="localizer"> /// </param> public AccountController( UserManager <IdentityUser> userManager, SignInManager <IdentityUser> signInManager, IEmailSender emailSender, ILogger <AccountController> logger, IUnitOfWork iUnitOfWork, RoleManager <IdentityRole> roleManager, ISysControllerSysActionService iSysControllerSysActionService, ISysRoleSysControllerSysActionService iSysRoleSysControllerSysActionService, ISysHelpService iSysHelpService, IAuthenticationSchemeProvider schemeProvider, IMemoryCache cache, IJsonDataService jsonDataService, IStringLocalizer <AccountController> localizer) { _userManager = userManager; _signInManager = signInManager; _emailSender = emailSender; _logger = logger; _iUnitOfWork = iUnitOfWork; _roleManager = roleManager; _iSysControllerSysActionService = iSysControllerSysActionService; _ISysRoleSysControllerSysActionService = iSysRoleSysControllerSysActionService; _ISysHelpService = iSysHelpService; _schemeProvider = schemeProvider; _cache = cache; this.jsonDataService = jsonDataService; _localizer = localizer; }
/// <summary> /// </summary> /// <param name="iJsonDataService"></param> /// <param name="unitOfWork"></param> public JsonDataController(IJsonDataService iJsonDataService, IUnitOfWork unitOfWork) { _iJsonDataService = iJsonDataService; _unitOfWork = unitOfWork; }
public static KeyValuePair <bool, string> IsValidCreateAdInputs(this AdDto dto, IConfiguration _configuration, IJsonDataService _jsonDataService) { List <string> errors = new List <string>(); dto.AdId = DateTime.UtcNow.Ticks.ToString(); dto.AdDisplayDays = _configuration["AdDefaultDisplayActiveDays"].ConvertToByte(); dto.AttachedAssetsInCloudStorageId = Guid.NewGuid(); dto.CreatedDateTime = dto.UpdatedDateTime = DateTime.UtcNow; dto.IsDeleted = false; dto.IsActivated = dto.IsPublished = true; if (string.IsNullOrWhiteSpace(_configuration["FolderPathForGoogleHtmlTemplate"])) { errors.Add("FolderPathForGoogleHtmlTemplate"); } if (string.IsNullOrWhiteSpace(_configuration["AdBucketNameInGoogleCloudStorage"])) { errors.Add("AdBucketNameInGoogleCloudStorage"); } if (string.IsNullOrWhiteSpace(_configuration["CacheExpireDays"])) { errors.Add("CacheExpireDays"); } if (!_jsonDataService.IsValidCategory(dto.AdCategoryId)) { errors.Add(nameof(dto.AdCategoryId)); } if (!_jsonDataService.IsValidCategory(dto.ItemConditionId)) { errors.Add(nameof(dto.ItemConditionId)); } //if (!_jsonDataService.IsValidCallingCode(int.Parse(dto.UserPhoneCountryCode))) // errors.Add(nameof(dto.UserPhoneCountryCode)); if (dto.AddressLongitude.IsValidLocation(dto.AddressLatitude)) { dto.IsValidLocation = true; } if (dto.IsValidLocation) { dto.Longitude = dto.AddressLongitude.ConvertToDouble(); dto.Latitude = dto.AddressLatitude.ConvertToDouble(); } return(new KeyValuePair <bool, string>(errors.Count > 0, string.Join(Path.PathSeparator, errors))); }
public BranchRepository(IJsonDataService jsonService) { jsonData = jsonService; }
public static KeyValuePair <bool, string> IsValidSearchInputs(this AdSearchDto options, IJsonDataService _jsonDataService) { List <string> errors = new List <string>(); if (!string.IsNullOrEmpty(options.SearchText)) { options.IsValidSearchText = true; options.SearchText = options.SearchText.Trim().ToLower(); } options.IsValidCategory = true; options.ConditionId = _jsonDataService.GetCategoryOrDefault(options.CategoryId).Key; options.IsValidCondition = true; options.ConditionId = _jsonDataService.GetConditionOrDefault(options.ConditionId).Key; if (_jsonDataService.IsValidCountryCode(options.CountryCode)) { options.IsValidCountryCode = true; options.CountryCode = options.CountryCode.Trim().ToUpper(); } if (_jsonDataService.IsValidCurrencyCode(options.CurrencyCode)) { options.IsValidCurrencyCode = true; options.CurrencyCode = options.CurrencyCode.Trim().ToUpper(); } if (!string.IsNullOrEmpty(options.CityName)) { options.IsValidCityName = true; options.CityName = options.CityName.Trim().ToLower(); } if (!string.IsNullOrEmpty(options.ZipCode)) { options.IsValidZipCode = true; options.ZipCode = options.ZipCode.Trim().ToLower(); } if (!string.IsNullOrWhiteSpace(options.MinPrice) && !string.IsNullOrWhiteSpace(options.MaxPrice)) { options.ItemCostMin = Utility.ConvertToDoubleFromString(options.MinPrice); options.ItemCostMax = Utility.ConvertToDoubleFromString(options.MaxPrice); if (options.ItemCostMin >= 0 && options.ItemCostMax >= 0 && options.ItemCostMin <= options.ItemCostMax) { options.IsValidPrice = true; } } else if (!string.IsNullOrWhiteSpace(options.MinPrice) && string.IsNullOrWhiteSpace(options.MaxPrice)) { options.ItemCostMin = Utility.ConvertToDoubleFromString(options.MinPrice); if (options.ItemCostMin > 0) { options.IsValidMinPrice = true; } } else if (string.IsNullOrWhiteSpace(options.MinPrice) && !string.IsNullOrWhiteSpace(options.MaxPrice)) { options.ItemCostMax = Utility.ConvertToDoubleFromString(options.MaxPrice); if (options.ItemCostMax > 0) { options.IsValidMaxPrice = true; } } KeyValueDescription mileOption = _jsonDataService.GetMileOptionById(options.MileOptionsId); if (mileOption != null) { options.IsValidMileOption = true; if (options.MileOptionsId == byte.MaxValue) { options.Miles = double.MaxValue; } else { options.Miles = options.MileOptionsId; } } options.IsValidSortOption = true; options.SortOptionsId = _jsonDataService.GetSortOptionByIdOrDefault(options.SortOptionsId).Key; if (!string.IsNullOrWhiteSpace(options.MapLattitude) && !string.IsNullOrWhiteSpace(options.MapLongitude) && Utility.IsValidLatitude(options.MapLattitude) && Utility.IsValidLongitude(options.MapLongitude)) { IPoint point = Utility.CreatePoint(longitude: options.MapLongitude, latitude: options.MapLattitude); if (point != null) { options.IsValidLocation = true; options.MapLocation = point; } } return(new KeyValuePair <bool, string>(errors.Count > 0, string.Join(Path.PathSeparator, errors))); }
/// <summary> /// </summary> /// <param name="iHolidayService"> /// </param> /// <param name="unitOfWork"> /// </param> /// <param name="jsonDataService"> /// </param> public HolidayController(IHolidayService iHolidayService, IUnitOfWork unitOfWork, IJsonDataService jsonDataService) { _iHolidayService = iHolidayService; _unitOfWork = unitOfWork; this.jsonDataService = jsonDataService; }
/// <summary> /// </summary> /// <param name="iResInfo"></param> /// <param name="jsonDataService"></param> /// <param name="unitOfWork"></param> public AssistantController(IResInfo iResInfo, IJsonDataService jsonDataService, IUnitOfWork unitOfWork) { _IResInfo = iResInfo; this.jsonDataService = jsonDataService; this.unitOfWork = unitOfWork; }
/// <summary> /// </summary> /// <param name="unitOfWork"> /// </param> /// <param name="iCityCodeService"> /// </param> /// <param name="iSysUserService"> /// </param> public KnowledgeBaseController(IUnitOfWork unitOfWork, IJsonDataService jsonDataService) { _unitOfWork = unitOfWork; this.jsonDataService = jsonDataService; }
/// <summary> /// /// </summary> /// <param name="service"></param> public JsonDataController(IJsonDataService service) { this.service = service; }
public JsonRepository(IJsonDataService jsonService) { CarRepository = jsonService.GetRepository <CarRepository>("cars"); }
/// <summary> /// </summary> /// <param name="unitOfWork"> /// </param> /// <param name="iCityCodeService"> /// </param> /// <param name="iSysUserService"> /// </param> public DataDictionaryController(IUnitOfWork unitOfWork, IJsonDataService jsonDataService) { _unitOfWork = unitOfWork; this.jsonDataService = jsonDataService; }
/// <summary> /// </summary> /// <param name="iResInfo"></param> /// <param name="jsonDataService"></param> /// <param name="unitOfWork"></param> public DataDictionaryController(IResInfo iResInfo, IJsonDataService jsonDataService, IUnitOfWork unitOfWork) { _IResInfo = iResInfo; this.jsonDataService = jsonDataService; this.unitOfWork = unitOfWork; }
public MainViewModel(IJsonDataService jsonDataService, IFileIOService fileIoService) { _jsonDataService = jsonDataService; _fileIOService = fileIoService; }
public static KeyValuePair <bool, string> IsValidSearchInputs(this AdSearchDto options, IConfiguration _configuration, IJsonDataService _jsonDataService) { List <string> errors = new List <string>(); #region All General if (string.IsNullOrWhiteSpace(_configuration["SqlServerFullTextIndexLanguage"])) { errors.Add("SqlServerFullTextIndexLanguage"); } if (!string.IsNullOrEmpty(options.SearchText)) { options.IsValidSearchText = true; options.SearchText = options.SearchText.Trim().ToLower(); } options.IsValidCategory = true; options.ConditionId = _jsonDataService.GetCategoryOrDefault(options.CategoryId).Key; options.IsValidCondition = true; options.ConditionId = _jsonDataService.GetConditionOrDefault(options.ConditionId).Key; if (_jsonDataService.IsValidCountryCode(options.CountryCode)) { options.IsValidCountryCode = true; options.CountryCode = options.CountryCode.Trim().ToUpper(); } if (_jsonDataService.IsValidCurrencyCode(options.CurrencyCode)) { options.IsValidCurrencyCode = true; options.CurrencyCode = options.CurrencyCode.Trim().ToUpper(); } if (!string.IsNullOrEmpty(options.CityName)) { options.IsValidCityName = true; options.CityName = options.CityName.Trim().ToLower(); } if (!string.IsNullOrEmpty(options.ZipCode)) { options.IsValidZipCode = true; options.ZipCode = options.ZipCode.Trim().ToLower(); } #endregion #region Price if (!string.IsNullOrWhiteSpace(options.MinPrice) && !string.IsNullOrWhiteSpace(options.MaxPrice)) { options.ItemCostMin = options.MinPrice.ConvertToDoubleOrZero(); options.ItemCostMax = options.MaxPrice.ConvertToDoubleOrZero(); if (options.ItemCostMin >= 0 && options.ItemCostMax >= 0 && options.ItemCostMin <= options.ItemCostMax) { options.IsValidPrice = true; } } else if (!string.IsNullOrWhiteSpace(options.MinPrice) && string.IsNullOrWhiteSpace(options.MaxPrice)) { options.ItemCostMin = options.MinPrice.ConvertToDoubleOrZero(); if (options.ItemCostMin > 0) { options.IsValidMinPrice = true; } } else if (string.IsNullOrWhiteSpace(options.MinPrice) && !string.IsNullOrWhiteSpace(options.MaxPrice)) { options.ItemCostMax = options.MaxPrice.ConvertToDoubleOrZero(); if (options.ItemCostMax > 0) { options.IsValidMaxPrice = true; } } #endregion #region Mile Option KeyValueDescription mileOption = _jsonDataService.GetMileOptionById(options.MileOptionsId); if (mileOption != null) { options.IsValidMileOption = true; if (options.MileOptionsId == byte.MaxValue) { options.Miles = double.MaxValue; } else { options.Miles = options.MileOptionsId; } } #endregion #region Location if (options.MapLongitude.IsValidLocation(options.MapLatitude)) { options.IsValidLocation = true; } if (options.IsValidLocation) { options.Longitude = options.MapLongitude.ConvertToDouble(); options.Latitude = options.MapLatitude.ConvertToDouble(); options.MapLocation = new Point(options.Longitude, options.Latitude) { SRID = 4326 }; } #endregion #region Pagination if (options.PageSize <= 0) { options.PageSize = _configuration["DefaultItemsCount"].ConvertToInt(); } if (options.PageCount.HasValue && options.PageCount.Value > 0) { options.IsValidPageCount = true; } else { options.IsValidPageCount = false; options.PageCount = default(int?); } if (options.Page < 1) { options.Page = 1; } else if (options.IsValidPageCount && options.PageCount.Value < options.Page) { options.Page = options.PageCount.Value; } #endregion #region Sorting options.IsValidSortOption = true; options.SortOptionsId = _jsonDataService.GetSortOptionByIdOrDefault(options.SortOptionsId).Key; #endregion return(new KeyValuePair <bool, string>(errors.Count > 0, string.Join(Path.PathSeparator, errors))); }
public UpdateController(IJsonDataService jsonDataService, IQueueForwarder queueForwarder) { _jsonDataService = jsonDataService; _queueForwarder = queueForwarder; }
/// <summary> /// </summary> /// <param name="unitOfWork"> /// </param> /// <param name="iCityCodeService"> /// </param> /// <param name="iSysUserService"> /// </param> public CityCodeController(IUnitOfWork unitOfWork, IJsonDataService jsonDataService) { _unitOfWork = unitOfWork; this.jsonDataService = jsonDataService; }