getting null trying to call a service

Very beginning of writing this..but cant get past this null error...Please look....

I get a null on DependencyResolver.Current.GetService<iContactEntityEditService>()


namespace WebSite.Controllers
{
    public class ContactController : AppController
    {
        private SystemLogHandler _systemLog = new SystemLogHandler(System.Reflection.Assembly.GetExecutingAssembly());
        public ActionResult ContactEntityEdit()
        {

            GenericGrids genericGrid = null;
            ContactEntityEditViewModel vm = new ContactEntityEditViewModel();

            vm.GridName = "contactEntity-crud";
            vm.UserSessionVariables.SessionId.ToString();
            vm.SiteName = vm.UserSessionVariables.SiteName;

            vm.SiteCode = vm.UserSessionVariables.SiteCode;
            vm.SiteId = vm.UserSessionVariables.SiteId;          

            string sessionId = this.AppService.UserSessionVariables.SessionId.ToString();

            iContactEntityEditService sv = GetService<iContactEntityEditService>();            
            //DependencyResolver.Current.GetService<iContactEntityEditService>().GetGenericGridInfo("contactEntity-crud",""); 
            genericGrid = sv.GetGenericGridInfo("contactEntity-crud", sessionId);

            vm.ContactEntityEditViewModel.HeaderTextLeft = "Contact Entity Editor";
            vm.ContactEntityEditViewModel.Icon = (genericGrid.HeaderIcon.StartsWith("fa-") ? "fa " : "") + genericGrid.HeaderIcon;



            return View("ContactEntityEdit", vm);
        }

      
     
        protected static T GetService<T>()
        {
            return (T)GlobalConfiguration.Configuration.DependencyResolver.GetService(typeof(T));
        }
    }
}

Open in new window

LVL 11
Robb HillSenior .Net DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndyAinscowFreelance programmer / ConsultantCommented:
Just what is iContactEntityEditService ?
You might be getting a null returned because there isn't one of those available.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.