/// <summary> /// Populates a view model with content input queried from the Umbraco context /// </summary> /// <typeparam name="TModel">Type of model to populate</typeparam> /// <returns>View model instance</returns> public TModel Build <TModel>() where TModel : new() { var create = new TModel(); var handler = _handlerResolver.Resolve <TModel>(); handler.Handle(create); return(create); }
public void Dispatch <T>() where T : ICommand { var handler = _resolver.Resolve <T>(); if (handler != null) { handler.Handle(); } }
public void Dispatch <T>(T command) where T : IPersonCommand { var handler = _resolver.Resolve <T>(); if (handler != null) { handler.Handle(command); } }