Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Anamika 4 posts 74 karma points
    Dec 08, 2017 @ 06:15
    Anamika
    0

    Custom notification service

    I am trying to implement a custom notification service in umbraco using the following link.

    http://www.felinesoft.com/blog/replacing-umbraco-services-notification-service.

    I have followed the steps mentioned in the article. As part of that, I have created a global.cs file as follows.

    public class Global : UmbracoApplication { protected override IBootManager GetBootManager() { return new MyBootManager(this); } }

    But the break point never hits this code section. Am I missing something here? Any help is appreciated.

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Dec 08, 2017 @ 07:30
    David Brendel
    0

    Hi Anamika,

    have you replaced the default class in the global.asax with your custom one?

    <%@ Application Inherits="Umbraco.Web.UmbracoApplication" Language="C#" %>
    

    So the "inherits" part has to be replaced with your class.

    Regards David

  • Anamika 4 posts 74 karma points
    Dec 08, 2017 @ 08:06
    Anamika
    0

    Hi David, Thanks for the reply. Yes, it hits now.

    But, still having issue on executing CreateServiceContext() method.

    public class MyBootManager : WebBootManager
    {
        public MyBootManager(UmbracoApplicationBase umbracoApplication) : base(umbracoApplication)
        {
        }
        protected override ServiceContext CreateServiceContext(DatabaseContext dbContext, IScopeProvider scopeProvider)
        {
            var serviceCtx = base.CreateServiceContext(dbContext, scopeProvider);  
            var newServiceCtx = new ServiceContext(serviceCtx.ContentService, serviceCtx.MediaService,
            serviceCtx.ContentTypeService, serviceCtx.DataTypeService,
            serviceCtx.FileService, serviceCtx.LocalizationService, serviceCtx.PackagingService,
            serviceCtx.EntityService, serviceCtx.RelationService,
            serviceCtx.MemberGroupService, serviceCtx.MemberTypeService, serviceCtx.MemberService,
            serviceCtx.UserService, serviceCtx.SectionService,
            serviceCtx.ApplicationTreeService, serviceCtx.TagService,
            new MyNotificationService(serviceCtx.NotificationService),
            serviceCtx.TextService,
            serviceCtx.AuditService,
            serviceCtx.DomainService, serviceCtx.TaskService, serviceCtx.MacroService,
            serviceCtx.PublicAccessService, serviceCtx.ExternalLoginService,
            serviceCtx.MigrationEntryService, serviceCtx.RedirectUrlService);
            return newServiceCtx;
        }   
    }
    

    enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft