public CoolerController(IGenericService <CoolerDTO> genericService, IGenericService <CoolerDTO> cartService, IUserService userService, IMapper mapper) { _genericService = genericService; _cartService = cartService; _userService = userService; _mapper = mapper; }
public BooksHistoryController(IGenericService <BookHistory> service, IMapper mapper) { this._service = service; this._mapper = mapper; this._dataSource = this._service.Get().AsQueryable(); var list = _dataSource.ToList(); }
public MustOwnHandler( IGenericService <T> eventService, IHttpContextAccessor httpContextAccessor) { this._eventService = eventService ?? throw new ArgumentNullException(nameof(eventService)); this._httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor)); }
/// <summary> /// Initializes a new instance of the <see cref="LearningLineController"/> class. /// </summary> /// <param name="goalService">Provides specific data operations for the <see cref="Goal"/> model.</param> /// <param name="activityLoggerService">When overridden in a derived form, provides functionality for loggers that handle events raised by the url that the request came through.</param> public LearningLineController(IGenericService <LearningLine> learningLineService, IGenericService <Goal> goalService, IObjectFinderService <Goal> goalFinder, IManyToManyMapperService <LearningLine, LearningLineGoal, Goal> mapperService) { this.learningLineService = learningLineService; this.goalService = goalService; this.mapperService = mapperService; this.goalFinder = goalFinder; }
public CardInfoController(IGenericService <CardInfoDTO> cardInfoService, IGenericService <CardSeriesDTO> cardSeriesService, IGenericService <CardTypeDTO> cardTypeService, IMapper mapper) { _cardInfoService = cardInfoService; _cardSeriesService = cardSeriesService; _cardTypeService = cardTypeService; _mapper = mapper; }
public TrackingRecordController(IServiceProvider serviceProvider) { mapper = serviceProvider.GetService <IMapper>(); appUserSessionService = serviceProvider.GetService <IAppUserSessionService>(); trackingRecordService = serviceProvider.GetService <ITrackingRecordService>(); trackingRecordGenericService = serviceProvider.GetService <IGenericService <TrackingRecord> >(); }
public FileController(IGenericService <FileEntry> fileEntryService, IFileStorageManager fileManager, IMessageSender <FileUploadedEvent> fileUploadedEventSender, IMessageSender <FileDeletedEvent> fileDeletedEventSender) { _fileEntryService = fileEntryService; _fileManager = fileManager; _fileUploadedEventSender = fileUploadedEventSender; _fileDeletedEventSender = fileDeletedEventSender; }
public ItemController(IItemService itemService, IBrandService brandService, IGenericService <Category> categoryService, IMapper autoMapper) { this._categoryService = categoryService ?? throw new ArgumentNullException(nameof(categoryService)); this._autoMapper = autoMapper ?? throw new ArgumentNullException(nameof(autoMapper)); this._brandService = brandService ?? throw new ArgumentNullException(nameof(brandService)); this._itemService = itemService ?? throw new ArgumentNullException(nameof(itemService)); }
public HomeController() { context = new TeamGoogleMapContext(); addressesService = new TempService <Address>(); streetsService = new TempService <Street>(); subdivisionsService = new TempService <Subdivision>(); }
public HomeController(IConfiguration config, IGenericService <PoliticaPublica> politicaPublicaService, IGenericService <Vaga> vagaService) { _politicaPublicaService = politicaPublicaService; _VagaService = vagaService; _configuration = config; Prepare(); }
public VmProductFind(int CategoryId, IGenericService <SubCategoryDTO> subCategoryService, IGenericService <ManufacturerDTO> manufacturerService, IGenericService <TasteCategoryDTO> tasteCategoryService, IGenericService <CategoryDTO> categoryService) { paging = new PagingInfo() { CurrentPage = 1, ItemsPerPage = 6 }; this.CategoryId = CategoryId; this.subCategoryService = subCategoryService; this.manufacturerService = manufacturerService; this.tasteCategoryService = tasteCategoryService; this.categoryService = categoryService; CategoryName = categoryService.Get(CategoryId).CategoryName; SubCategorySelects = subCategoryService.FindBy(c => c.CategoryId == CategoryId) .Select(c => new SubCategoryCheck { SubCategoryId = c.SubCategoryId, SubCategoryName = c.SubCategoryName }).ToList(); TasteCategorySelects = tasteCategoryService.FindBy(c => c.CategoryId == CategoryId) .Select(c => new TasteCategoryCheck { TasteCategoryId = c.TasteCategoryId, TasteCategoryName = c.TasteCategoryName }).ToList(); ManufacturerSelects = manufacturerService.GetAll() .Select(c => new ManufacturerCheck { ManufacturerId = c.ManufacturerId, ManufacturerName = c.ManufacturerName }).ToList(); }
CustomerInfo customerInfo;// public CartController(IGenericService <ProductPriceDTO> prodPriceServ, IGenericService <OrderDTO> _orderService, IGenericService <OrderPositionDTO> _orderPosService) { productPriceService = prodPriceServ; orderService = _orderService; orderPosService = _orderPosService; }
public ActionResult AtualizarPessoaColaborador([FromServices] IGenericService <Pessoa> genPessoaSvc, [FromServices] IGenericService <Colaborador> genColaboradorSvc, [FromServices] IPessoaService pessoaSvc, [FromBody] PessoaColaborador pcv) { try { if (pcv.pessoa.TipoId == 1) { pcv.pessoa.EmpresaId = 1; } var pessoaEditadda = genPessoaSvc.Atualizar(pcv.pessoa); if (pcv.pessoa.TipoId == 1) { genColaboradorSvc.Atualizar(pcv.colaborador); } pessoaSvc.AtualizarPessoaColaborador(pcv.pessoa.Id, pcv.pessoa.TipoId, pcv.Telefones, pcv.FerramentasAssociadas, pcv.SiglasAssociadas); return(Ok(new Retorno() { Codigo = 200, Data = "Edição realizada com sucesso" })); } catch (Exception ex) { return(BadRequest(new Retorno() { Codigo = 500, Mensagem = ex.Message })); } }
public static async Task <Dosyalar> Kaydet(IFormFile file, IGenericService genericService) { var resim = $"{DateTime.Now:yyyyMMddHHmmss.}{Path.GetFileName(file.FileName).Split(".").Last()}"; var filePath = Path.Combine(Dir, resim).Replace("admin.", ""); using (var fileStream = new FileStream(filePath, FileMode.Create)) { await file.CopyToAsync(fileStream); } // string data; // using (var memoryStream = new MemoryStream()) // { // file.CopyTo(memoryStream); // data = Convert.ToBase64String(memoryStream.ToArray()); // } var dosya = new Dosyalar { Adi = resim, Boyutu = file.Length, Tipi = file.ContentType, Yolu = filePath }; await genericService.Save(dosya); return(dosya); }
public IActionResult Index([FromServices] IGenericService <TeamMember> teamSvc, [FromServices] IGenericService <Customer> customerSvc, CommonViewModel model) { model.Team = teamSvc.GetAll(); model.Customers = customerSvc.GetAll(); if (ModelState.IsValid) { try { TesteEnvioEmail(model.Email.CustomerEmail, model.Email.Subject, model.Email.Message, model.Email.Name).GetAwaiter(); model.StatusModel = "true"; View("Index", model); } catch (Exception ex) { model.StatusModel = "error"; View("Index", model); } } else { model.StatusModel = "false"; } return(View("Index", model)); }
/// <summary> /// Constructor /// </summary> /// <param name="genericService"></param> public ObjectFinderService(IGenericService <T> genericService) { this.genericService = genericService; cache = new List <T>(); cachedParams = new string[0]; }
public UserController() { _employeeService = new EmployeeService(new EmployeeRepository(db)); _postService = new PostService(new PostRepository(db)); _companyService = new CompanyService(new CompanyRepository(db)); _adressService = new AddressService(new AddressRepository(db)); }
public VmFindByFilter(IGenericService <GoodDTO> goodService, IGenericService <PhotoDTO> photoService, VmGoodFind vmFind) { this.goodService = goodService; this.photoService = photoService; this.vmFind = vmFind; var goods = goodService.FindBy(vmFind.Predicate); if (goods.Count() == 0 || goods == null) { return; } Photos = new List <PhotoFindByFilter>(); foreach (var good in goods) { var photo = photoService.FindBy(p => p.GoodId == good.GoodId).FirstOrDefault(); string photopath = (photo == null) ? "/Files/NoImage.png" : photo.PhotoPath; var photoFindByFilter = new PhotoFindByFilter { GoodId = good.GoodId, GoodName = good.GoodName, PhotoPath = photopath }; Photos.Add(photoFindByFilter); } }
public IActionResult Atualizar([FromServices] IGenericService <T> svc, [FromBody] T obj, int id) { try { var exists = svc.Obter(id); if (exists == null) { return(NotFound()); } if (!obj.Validate()) { return(BadRequest(obj)); } if (obj.Id == 0) { obj.Id = id; } var result = svc.Atualizar(obj); return(Ok(result)); } catch (Exception ex) { return(StatusCode(500, ex)); } }
public UsersController(IGenericService <LibraryUser> service, IMapper mapper) { this._service = service; this._mapper = mapper; _dataSource = this._service.Get().AsQueryable(); var list = _dataSource.ToList(); }
public GenericInjectionTestClass(string name, IGenericService <A> printService, B[] itemsArray, IEnumerable <C> enumerable) { CollectionName = name; Printer = printService; ItemsAll = itemsArray; Items = enumerable; }
public SensorController(IConfiguration config, IGenericService <Sensor> sensorService) { this._configuration = config; this._sensorService = sensorService; Prepare(); }
public MainTask( ILogger <MainTask> logger, IBitCoinTradeService bitCoinTradeService, IGenericService genericService, INotificationService notificationService, IDecisionMakerService decisionMakerService, ITaskAwaitToBuy awaitToBuyTask, ITaskBuy BuyTask, ITaskSell SellTask, ITaskAwaitToSell awaiToSellTask, ICryptoCurrencyService cryptoCurrencyService ) { _notificateBotIsAlive = true; this._logger = logger; this._bitCoinTradeService = bitCoinTradeService; this._genericService = genericService; this._notificationService = notificationService; this._decisionMakerService = decisionMakerService; this._awaitToBuyTask = awaitToBuyTask; this._buyTask = BuyTask; this._cryptoCurrencyService = cryptoCurrencyService; this._sellTask = SellTask; this._awaiToSellTask = awaiToSellTask; }
public RentController(IHouseService houseService, IGenericService <Province> provinceService, IGenericService <Feature> featureService, IMapper autoMapper) { this._houseService = houseService; this._provinceService = provinceService; this._featureService = featureService; _autoMapper = autoMapper; }
public MaterialMasterController(IGenericService<MaterialMaster, int> _matetialService, IGenericService<UnitMaster, int> _unitMasterService, IGenericService<ProductTransactionDetail, int> productTransactionService, IGenericService<RateMaster, int> rateMasterService) { _IMaterialMasterService = _matetialService; _IUnitMasterService = _unitMasterService; _IProductTransactionService = productTransactionService; _IRateMasterService = rateMasterService; }
public ProductsController(IProductService productService, Dispatcher dispatcher, ILogger <ProductsController> logger, IGenericService <SmsMessage> smsMessageService) { _productService = productService; _dispatcher = dispatcher; _logger = logger; _smsMessageService = smsMessageService; }
public TicketController(ITicketService ticketService, IVoyageService voyageService, IGenericService <Location> locationService, IGenericService <Bus> busService) { _ticketService = ticketService; _voyageService = voyageService; _locationService = locationService; _busService = busService; }
public BarragemController(IConfiguration config, IGenericService <Barragem> barragemService) { this._configuration = config; this._barragemService = barragemService; Prepare(); }
public MonitoramentoController(IConfiguration config, IGenericService <Regiao> regiaoService) { this._configuration = config; this._regiaoService = regiaoService; Prepare(); }
/// <summary> /// Default constructor /// </summary> /// <param name="service"></param> public InvoiceController() : this(new InvoiceService(new GenericRepository <Invoice>(new DataAccess.Contexts.MainDbContext()), new GenericRepository <InvoiceDetail>(new DataAccess.Contexts.MainDbContext()))) { _db = new MainDbContext(); _customerService = new GenericService <Customer, Guid>(new GenericRepository <Customer>(_db)); _productService = new GenericService <Product, Guid>(new GenericRepository <Product>(_db)); }
public void Add(Type serviceType, IGenericService genericService) { lock (_sync) { List<IGenericService> genericEntry; if (!_genericServices.TryGetValue(serviceType, out genericEntry)) { genericEntry = new List<IGenericService>(); _genericServices[serviceType] = genericEntry; } genericEntry.Add(genericService); } }
public void GivenIHaveCreatedAPersonReadOnlyGenericRepository(string service) { switch (service.StripQuotations()) { case "read only": _readOnlyService = null; break; case "generic": _genericService = null; break; case "keyed": _keyedService = null; break; } }
public PhoneTypesController(IGenericService genericService) { _genericService = genericService; }
public EmailsController(IEmailService emailService, IGenericService genericService) { _emailService = emailService; _genericService = genericService; }
public GenericServiceHostImpl(IGenericService<string> service) { Service = service; }
public PeopleController(IGenericService genericService) { _genericService = genericService; }
public AddressTypesController(IGenericService genericService) { _genericService = genericService; }
public HomeController(IGenericService<IProject> projectService) { _projectService = projectService; }
public AddressesController(IAddressService addressService, IGenericService genericService) { _addressService = addressService; //_addressTypeService = addressTypeService; _genericService = genericService; }
public EmailTypesController(IGenericService genericService) { _genericService = genericService; }