/// <summary> /// Execute upload command /// </summary> /// <param name="entity"></param> /// <returns></returns> public static ICommandResult Upload(IEntity entity) { if (entity.GetType() == typeof(Upload)) { var uploadData = (Upload)entity; LoginResult loginResult = (LoginResult)uploadData.ID.Id; IUploadPresenter presenter = ServiceLocator.GetObject <IUploadPresenter>(ServiceLocator.GetObject <IUploadView>(loginResult.SessionId)); presenter.Upload(null, uploadData); return(presenter); } throw new ArgumentOutOfRangeException("entity", string.Format("{0} Entity is not supported.", entity.GetType())); }