2

Is it possible to create a "Master" timer job in SharePoint 2013 and lets say inherit from it in future timer jobs?

I want to create a lets call it template and build further timer jobs on top of this base. Like you can inherit from a Class or something.

If it is not possible this way, is there a alternative way to archieve what I wrote above?

0

If you are looking for a template, you can create a Interface class. Example:

public interface ICustomMethods
{
    void CustomMember1();
    int CustomMember2();
}     

and then inherit it in your public classes that are created for your timer jobs.

public class CustomJob: SPJobDefinition, ICustomMethods
{
void CustomMember1()
{
//Your Code
}
int CustomMember2()
{
//Your Code
return int;
}


   ..

}

However, If you want to avoid code duplicacy, you can create a base class, inherit it and use its members.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.