public DocumentController( IUserService IUserService, IRelationService IRelationService, IDocumentService IDocumentService, IEmployementService IEmployementService, IDocumentDetailsService IDocumentDetailsService, IDocumentCategoryService IDocumentCategoryService, IEducationDocumentCategoryMappingService IEducationDocumentCategoryMappingService, ICandidateProgressDetailService ICandidateProgressDetailService, IPersonalService IPersonalService, IEmployeeService IEmployeeService, IEmploymentCountService IEmploymentCountService) { _IUserService = IUserService; _IRelationService = IRelationService; _IEmployementService = IEmployementService; _IDocumentDetailsService = IDocumentDetailsService; _IDocumentCategoryService = IDocumentCategoryService; _IDocumentService = IDocumentService; _IEducationDocumentCategoryMappingService = IEducationDocumentCategoryMappingService; _ICandidateProgressDetailService = ICandidateProgressDetailService; _IPersonalService = IPersonalService; _IEmploymentCountService = IEmploymentCountService; _loginDetails = new LoginDetail(); _document = new Master_Document(); _docDetails = new DocumentDetail(); _employment = new EmploymentDetail(); _DocumetCat = new Master_DocumentCategory(); _DocumetCatNew = new Master_DocumentCategory(); _educationDocumentCategoryMapping = new EducationDocumentCategoryMapping(); _IEmployeeService = IEmployeeService; }
/// <summary> /// Creates a partial service context with only some services (for tests). /// </summary> /// <remarks> /// <para>Using a true constructor for this confuses DI containers.</para> /// </remarks> public static ServiceContext CreatePartial( IContentService contentService = null, IMediaService mediaService = null, IContentTypeService contentTypeService = null, IMediaTypeService mediaTypeService = null, IDataTypeService dataTypeService = null, IFileService fileService = null, ILocalizationService localizationService = null, IPackagingService packagingService = null, IEntityService entityService = null, IRelationService relationService = null, IMemberGroupService memberGroupService = null, IMemberTypeService memberTypeService = null, IMemberService memberService = null, IUserService userService = null, ISectionService sectionService = null, IApplicationTreeService treeService = null, ITagService tagService = null, INotificationService notificationService = null, ILocalizedTextService localizedTextService = null, IAuditService auditService = null, IDomainService domainService = null, IMacroService macroService = null, IPublicAccessService publicAccessService = null, IExternalLoginService externalLoginService = null, IServerRegistrationService serverRegistrationService = null, IRedirectUrlService redirectUrlService = null, IConsentService consentService = null) { Lazy <T> Lazy <T>(T service) => service == null ? null : new Lazy <T>(() => service); return(new ServiceContext( Lazy(publicAccessService), Lazy(domainService), Lazy(auditService), Lazy(localizedTextService), Lazy(tagService), Lazy(contentService), Lazy(userService), Lazy(memberService), Lazy(mediaService), Lazy(contentTypeService), Lazy(mediaTypeService), Lazy(dataTypeService), Lazy(fileService), Lazy(localizationService), Lazy(packagingService), Lazy(serverRegistrationService), Lazy(entityService), Lazy(relationService), Lazy(treeService), Lazy(sectionService), Lazy(macroService), Lazy(memberTypeService), Lazy(memberGroupService), Lazy(notificationService), Lazy(externalLoginService), Lazy(redirectUrlService), Lazy(consentService))); }
public CreditContractController( dbwebContext context, IBookingServices ibookService, IUserServices iuserService, ICustomerServices icustService, IRelationService irelaService, IContractGroupService icontGroupService, IContractTypeService iconTypeService, IZoneService izoneService, IBranchService ibranchService, ISysParameterService isysParamService, IStatusService istatusService ) { ctx = context; iBookService = ibookService; iUserService = iuserService; iCustService = icustService; iRelaService = irelaService; iContGroupService = icontGroupService; iContTypeService = iconTypeService; iZoneService = izoneService; iBranchService = ibranchService; iSysParamService = isysParamService; iStatusService = istatusService; }
public void Update_Bulk_Relations() { IRelationService rs = RelationService; DateTime date = DateTime.Now.AddDays(-10); IEnumerable <IRelation> newRelations = CreateRelations(10); foreach (IRelation r in newRelations) { r.CreateDate = date; r.UpdateDate = date; } // insert RelationService.Save(newRelations); Assert.IsTrue(newRelations.All(x => x.UpdateDate == date)); DateTime newDate = DateTime.Now.AddDays(-5); foreach (IRelation r in newRelations) { r.UpdateDate = newDate; } // update RelationService.Save(newRelations); Assert.IsTrue(newRelations.All(x => x.UpdateDate == newDate)); }
public RelationController(IRelationService relationService, IRelationNameService relationNameService, IPersonService personService) { this.relationService = relationService; this.relationNameService = relationNameService; this.personService = personService; }
private IRelation CreateAndSaveRelation(string name, string alias) { IRelationService rs = RelationService; var rt = new RelationType(name, alias, false, null, null); rs.Save(rt); ContentType ct = ContentTypeBuilder.CreateBasicContentType(); ContentTypeService.Save(ct); MediaType mt = MediaTypeBuilder.CreateImageMediaType("img"); MediaTypeService.Save(mt); Content c1 = ContentBuilder.CreateBasicContent(ct); Media c2 = MediaBuilder.CreateMediaImage(mt, -1); ContentService.Save(c1); MediaService.Save(c2); var r = new Relation(c1.Id, c2.Id, rt); RelationService.Save(r); return(r); }
/// <summary> /// Creates a bunch of content/media items return relation objects for them (unsaved) /// </summary> /// <param name="count"></param> /// <returns></returns> private IEnumerable <IRelation> CreateRelations(int count) { IRelationService rs = RelationService; string rtName = Guid.NewGuid().ToString(); var rt = new RelationType(rtName, rtName, false, null, null); rs.Save(rt); ContentType ct = ContentTypeBuilder.CreateBasicContentType(); ContentTypeService.Save(ct); MediaType mt = MediaTypeBuilder.CreateImageMediaType("img"); MediaTypeService.Save(mt); return(Enumerable.Range(1, count).Select(index => { Content c1 = ContentBuilder.CreateBasicContent(ct); Media c2 = MediaBuilder.CreateMediaImage(mt, -1); ContentService.Save(c1); MediaService.Save(c2); return new Relation(c1.Id, c2.Id, rt); }).ToList()); }
/// <summary> /// /// </summary> /// <param name="azureClient"></param> /// <param name="cache"></param> /// <param name="localtionService"></param> /// <param name="httpService"></param> /// <param name="roleRepository"></param> /// <param name="permissionService"></param> /// <param name="requestStatusRepository"></param> /// <param name="options"></param> public UserService(IAzureAdClient azureClient, IMemoryCache cache, ILocaltionService localtionService, IRelationService httpService, IRoleRepository roleRepository, IPermissionService permissionService, IRequestStatusRepository requestStatusRepository, ICpUsersRepository cpUsersRep, IOptionsMonitor <ProjectSettingsOption> options) { _azureClient = azureClient ?? throw new ArgumentNullException(nameof(azureClient)); _localtionService = localtionService ?? throw new ArgumentNullException(nameof(localtionService)); _cache = cache ?? throw new ArgumentNullException(nameof(cache)); _httpService = httpService ?? throw new ArgumentNullException(nameof(httpService)); _cpUsersRep = cpUsersRep ?? throw new ArgumentNullException(nameof(cpUsersRep)); _roleRepository = roleRepository ?? throw new ArgumentNullException(nameof(roleRepository)); _permissionService = permissionService ?? throw new ArgumentNullException(nameof(permissionService)); _requestStatusRepository = requestStatusRepository ?? throw new ArgumentNullException(nameof(requestStatusRepository)); _projectUrl = options.CurrentValue?.ProjectUrl ?? throw new InvalidOperationException("Missing URL to Azure"); }
internal CandidateProgressDetails(IUserService IUserService, IRelationService IRelationService, ICandidateProgressDetailService ICandidateProgressDetailService, IEmploymentCountService IEmploymentCountService) { _IUserService = IUserService; _IRelationService = IRelationService; _ICandidateProgressDetailService = ICandidateProgressDetailService; _IEmploymentCountService = IEmploymentCountService; }
public MakeClassifierToInterfaceCommand( Classifier classifier, IRelationService relationService) { _classifier = classifier; _relationService = relationService; }
public RelationTypeSerializer(IEntityService entityService, IRelationService relationService, ILogger logger) : base(entityService, logger) { this.relationService = relationService; }
/// <summary> /// public ctor - will generally just be used for unit testing /// </summary> /// <param name="contentService"></param> /// <param name="mediaService"></param> /// <param name="contentTypeService"></param> /// <param name="dataTypeService"></param> /// <param name="fileService"></param> /// <param name="localizationService"></param> /// <param name="packagingService"></param> /// <param name="entityService"></param> /// <param name="relationService"></param> /// <param name="sectionService"></param> /// <param name="treeService"></param> /// <param name="tagService"></param> public ServiceContext( IContentService contentService, IMediaService mediaService, IContentTypeService contentTypeService, IDataTypeService dataTypeService, IFileService fileService, ILocalizationService localizationService, PackagingService packagingService, IEntityService entityService, IRelationService relationService, ISectionService sectionService, IApplicationTreeService treeService, ITagService tagService) { _tagService = new Lazy<ITagService>(() => tagService); _contentService = new Lazy<IContentService>(() => contentService); _mediaService = new Lazy<IMediaService>(() => mediaService); _contentTypeService = new Lazy<IContentTypeService>(() => contentTypeService); _dataTypeService = new Lazy<IDataTypeService>(() => dataTypeService); _fileService = new Lazy<IFileService>(() => fileService); _localizationService = new Lazy<ILocalizationService>(() => localizationService); _packagingService = new Lazy<PackagingService>(() => packagingService); _entityService = new Lazy<IEntityService>(() => entityService); _relationService = new Lazy<IRelationService>(() => relationService); _sectionService = new Lazy<ISectionService>(() => sectionService); _treeService = new Lazy<IApplicationTreeService>(() => treeService); }
public RelationsController() { relationService = ApplicationContext.Services.RelationService; contentService = ApplicationContext.Services.ContentService; mediaService = ApplicationContext.Services.MediaService; contentTypeService = ApplicationContext.Services.ContentTypeService; entityService = ApplicationContext.Services.EntityService; }
public UploadsController(ApplicationDbContext context, IImageService imageService, IRelationService relationService) { _context = context; _imageService = imageService; _relationService = relationService; }
public PersonsController(IMapper mapper, IPersonService personService, IRelationService relationService, IAppLogger <PersonsController> logger, IStringLocalizer <PersonsController> localizer, IWebHostEnvironment env) { this._personsService = personService; this._relationService = relationService; this._mapper = mapper; this._logger = logger; this.Localizer = localizer; this._env = env; }
public FamilyController(IRelationService IRelationService, IFamilyDetailsService IFamilyDetailsService, IPersonalService IPersonalService, IUserService IUserService) { _IRelationService = IRelationService; _relation = new Master_Relation(); _IFamilyDetailsService = IFamilyDetailsService; _employeeFamilyDetail = new EmployeeFamilyDetail(); _IPersonalService = IPersonalService; this._IUserService = IUserService; }
static void RelationService_DeletedRelationType(IRelationService sender, DeleteEventArgs <IRelationType> args) { var dc = DistributedCache.Instance; foreach (var e in args.DeletedEntities) { dc.RemoveRelationTypeCache(e.Id); } }
static void RelationService_SavedRelationType(IRelationService sender, SaveEventArgs <IRelationType> args) { var dc = DistributedCache.Instance; foreach (var e in args.SavedEntities) { dc.RefreshRelationTypeCache(e.Id); } }
public HomeController(ILogger <HomeController> logger, ApplicationDbContext context, UserManager <ToonUser> userManager, IRelationService relationService) { _logger = logger; _context = context; _userManager = userManager; _relationService = relationService; }
//Constructors needed for testability and DI public MembersWallController(UmbracoContext umbracoContext, IMemberService _memberService, IRelationService _relationService, IMyHelper _myHelper) : base(umbracoContext) { this._memberService = _memberService; this._relationService = _relationService; this._myHelper = _myHelper; }
///Constructors needed for testability and DI public CommentSurfaceController(UmbracoContext umbracoContext, IContentService _contentService, IMemberService _memberService, IRelationService _relationServices) : base(umbracoContext) { this._contentService = _contentService; this._memberService = _memberService; this._relationService = _relationServices; }
public RelationTypeController( ILogger <RelationTypeController> logger, IUmbracoMapper umbracoMapper, IRelationService relationService, IShortStringHelper shortStringHelper) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _umbracoMapper = umbracoMapper ?? throw new ArgumentNullException(nameof(umbracoMapper)); _relationService = relationService ?? throw new ArgumentNullException(nameof(relationService)); _shortStringHelper = shortStringHelper ?? throw new ArgumentNullException(nameof(shortStringHelper)); }
public RelationTypeTreeController( ILocalizedTextService localizedTextService, UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, IMenuItemCollectionFactory menuItemCollectionFactory, IRelationService relationService, IEventAggregator eventAggregator) : base(localizedTextService, umbracoApiControllerTypeCollection, eventAggregator) { _menuItemCollectionFactory = menuItemCollectionFactory; _relationService = relationService; }
public void Insert_Bulk_Relations() { IRelationService rs = RelationService; IEnumerable <IRelation> newRelations = CreateRelations(10); Assert.IsTrue(newRelations.All(x => !x.HasIdentity)); RelationService.Save(newRelations); Assert.IsTrue(newRelations.All(x => x.HasIdentity)); }
/// <summary> /// Initializes a new instance of the <see cref="NexuService"/> class. /// </summary> /// <param name="profiler"> /// The profiler. /// </param> /// <param name="relationService"> /// The relation Service. /// </param> /// <param name="propertyParserResolver"> /// The property Parser Resolver. /// </param> /// <param name="dataTypeService"> /// The data Type Service. /// </param> public NexuService( ProfilingLogger profiler, IRelationService relationService, PropertyParserResolver propertyParserResolver, IDataTypeService dataTypeService) { this.profiler = profiler; this.relationService = relationService; this.propertyParserResolver = propertyParserResolver; this.dataTypeService = dataTypeService; service = this; }
public RelateOnTrashNotificationHandler( IRelationService relationService, IEntityService entityService, ILocalizedTextService textService, IAuditService auditService, IScopeProvider scopeProvider) { _relationService = relationService; _entityService = entityService; _textService = textService; _auditService = auditService; _scopeProvider = scopeProvider; }
public ContentTemplateSerializer( IEntityService entityService, ILocalizationService localizationService, IRelationService relationService, ILogger logger, IContentService contentService, IFileService fileService, IContentTypeService contentTypeService, SyncValueMapperCollection syncMappers) : base(entityService, localizationService, relationService, logger, contentService, fileService, syncMappers) { this.contentTypeService = contentTypeService; }
public void Create_Relation_Type_Without_Object_Types() { IRelationService rs = RelationService; IRelationType rt = new RelationType("repeatedEventOccurence", "repeatedEventOccurence", false, null, null); Assert.DoesNotThrow(() => rs.Save(rt)); // re-get rt = RelationService.GetRelationTypeById(rt.Id); Assert.IsNull(rt.ChildObjectType); Assert.IsNull(rt.ParentObjectType); }
public void Setup() { string mqttEndPoint = Environment.GetEnvironmentVariable("MQTT_BROKER_ENDPOINT") ?? "localhost"; ChickenContainer.Builder.Register(s => new MqttClientConfigurationBuilder().ConnectTo(mqttEndPoint).WithName("test-relation-service-client")); ChickenContainer.Builder.Register(s => new MqttServerConfigurationBuilder().ConnectTo(mqttEndPoint).WithName("test-relation-service-server")); CommunicationIocInjector.Inject(); ChickenContainer.Builder.RegisterType <RelationServiceClient>().AsImplementedInterfaces(); ChickenContainer.Initialize(); _relationService = ChickenContainer.Instance.Resolve <IRelationService>(); }
public void Initialize()//This replaces the old OnApplicationStarted { //throw new NotImplementedException(); ContentService.Saved += ContentService_Saved; MediaService.Trashing += MediaService_Trashing; ContentService.Trashing += ContentService_Trashing; contentService = Current.Services.ContentService; relationService = Current.Services.RelationService; mediaService = Current.Services.MediaService; createRelations(); }
///Constructors needed for testability and DI public MyHelper(UmbracoContext _umbracoContext, IContentService _contentService, IMemberService _memberService, IMediaService _mediaService, IRelationService _relationServices, Database _database) { this._contentService = _contentService; this._memberService = _memberService; this._mediaService = _mediaService; this._relationService = _relationServices; this._database = _database; this._umbracoContext = _umbracoContext; }
public ContentTemplateSerializer( IEntityService entityService, ILocalizationService localizationService, IRelationService relationService, IShortStringHelper shortStringHelper, ILogger <ContentTemplateSerializer> logger, IContentService contentService, IFileService fileService, IContentTypeService contentTypeService, SyncValueMapperCollection syncMappers) : base(entityService, localizationService, relationService, shortStringHelper, logger, contentService, fileService, syncMappers) { this.contentTypeService = contentTypeService; this.umbracoObjectType = UmbracoObjectTypes.DocumentBlueprint; }
public AuthService(IPermissionService permissionService, IRequestStatusRepository requestStatusesRepository, IRelationService relationService, ILogger <AuthService> logger, IUserService userService, IOptionsMonitor <AuthServiceOptions> authServiceOptionsMonitor) { _permissionService = permissionService ?? throw new ArgumentNullException(nameof(permissionService)); _relationService = relationService ?? throw new ArgumentNullException(nameof(relationService)); _options = authServiceOptionsMonitor.CurrentValue ?? throw new ArgumentNullException(nameof(authServiceOptionsMonitor)); _userService = userService ?? throw new ArgumentNullException(nameof(userService)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _requestStatusesRepository = requestStatusesRepository ?? throw new ArgumentNullException(nameof(requestStatusesRepository)); }
public DashboardLogService(IScopeProvider scopeProvider, IUserService userService, IEntityService entityService, IContentTypeService contentTypeService, UmbracoMapper mapper, IContentService contentService, IMemberService memberService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, IDataTypeService dataTypeService, IRelationService relationService, IMediaService mediaService) { _scopeProvider = scopeProvider; _userService = userService; _entityService = entityService; _contentTypeService = contentTypeService; _mapper = mapper; _contentService = contentService; _memberService = memberService; _mediaTypeService = mediaTypeService; _memberTypeService = memberTypeService; _dataTypeService = dataTypeService; _relationService = relationService; _mediaService = mediaService; }
public void Can_Create_RelationType_Without_Name() { IRelationService rs = RelationService; IRelationType rt = new RelationType("Test", "repeatedEventOccurence", false, Constants.ObjectTypes.Document, Constants.ObjectTypes.Media); Assert.DoesNotThrow(() => rs.Save(rt)); // re-get rt = RelationService.GetRelationTypeById(rt.Id); Assert.AreEqual("Test", rt.Name); Assert.AreEqual("repeatedEventOccurence", rt.Alias); Assert.AreEqual(false, rt.IsBidirectional); Assert.AreEqual(Constants.ObjectTypes.Document, rt.ParentObjectType.Value); Assert.AreEqual(Constants.ObjectTypes.Media, rt.ChildObjectType.Value); }
public ClassifierSingleCommandContext( Classifier classifier, ClassifierDictionary classifierDictionary, DeletionService deletionService, IRelationService relationService, IAskUserBeforeDeletionService askUserService, MessageSystem messageSystem) { Rename = new RenameClassifierCommand( classifier, classifierDictionary, new ClassifierValidationService(classifierDictionary), messageSystem); ChangeBaseClass = new ChangeBaseClassCommand( classifier, classifierDictionary, messageSystem); Delete = new DeleteClassifierCommand(classifier, deletionService,askUserService); Visibility = new ShowOrHideSingleObjectCommand(classifier, messageSystem); ChangeClassifierColor = new ChangeColorCommand(classifier, messageSystem); ChangeNoteColor = new ChangeNoteColorCommand(classifier.Note,messageSystem); ChangeNoteText = new ChangeNoteTextCommand(classifier.Note,messageSystem); ChangeIsInterface = new MakeClassifierToInterfaceCommand(classifier, relationService); }
protected override void Init() { _relationService = For<IRelationService>(); }
private void RelationService_SavedRelation(IRelationService sender, SaveEventArgs<IRelation> e) { foreach (var savedEntity in e.SavedEntities) { if (savedEntity.RelationType.Alias.Equals("FormFormGroup")) { UpdateFormFormGroupRelations(savedEntity, false); } } }
/// <summary> /// RelationType needed in Umbraco deleted, re-create and re-index all Content Medias /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RelationService_DeletedRelationType(IRelationService sender, DeleteEventArgs<IRelationType> e) { LogHelper.Info<MediaContentUsage>(String.Format("RelationService_DeletedRelationType")); foreach (var item in e.DeletedEntities) { LogHelper.Debug<MediaContentUsage>(String.Format("item: {0}", item.Alias)); if (item.Alias == Constants.RelationTypeAlias) { CreateRelationType(); AddMediaUsageForAllContent(); } } }
private void RelationService_DeletedRelation(IRelationService sender, DeleteEventArgs<IRelation> e) { foreach (var deletedRelation in e.DeletedEntities) { if (deletedRelation.RelationType.Alias.Equals("FormFormGroup")) { UpdateFormFormGroupRelations(deletedRelation, true); } } }