public IActor ResolveArgumentActor(IActor resolvedActor, string[] parameters, IHandlerContext handlerContext) { if (parameters.Length != 1) { throw new SystemException("argument actor expects exactly one (the actor-id) parameter instead of " + parameters.Length); } IActor actor = null; try { string shortName = parameters[0]; actor = organizationApplication.FindActorByUniqueName(shortName); } catch (SystemException e) { throw new SystemException("can't resolve actor-argument with parameter " + parameters[0], e); } return(actor); }
public object Deserialize(string text) { if (text == null) { return(null); } IActor actor = null; IOrganizationApplication organizationApplication = ServiceLocator.Current.GetInstance <IOrganizationApplication>(); try { actor = organizationApplication.FindActorByUniqueName(text); } catch (Exception t) { throw new ArgumentException("couldn't deserialize " + text + " to a User : "******" : " + t.Message); } return(actor); }