C# passing objects to different methods : <p>I have a quick question. I have an object that I am trying to pass to a different method in a different class. </p>

<pre><code> public virtual void Geocode(ICustomer customer)
    {
        RouteObjects.Customer roCustomer = customer as RouteObjects.Customer;

        if (customer != null)
        {
            RouteObjectsRepository.Geocode(roCustomer);
            GeoCodeUpdateEventPublisher.UpdateGeoCustomer(roCustomer);
        }
    }
</code></pre>

<p>I am trying to pass the roCustomer object to GeoCodueUpdateEventPublisher in method updategeocustomer. my updateGeoCustomer looks like this </p>

<pre><code> public virtual void UpdateGeoCustomer(object roCustomer)
    {
        Publish(roCustomer); 
    }
</code></pre>

<p>I wanted to know if this is the proper way to pass this object? I am then going to call method publish and it will look something like this.</p>

<pre><code> protected virtual void Publish(object roCustomer)
    {

            PublishMessage publishMessage = CreatePublishMessage(roCustomer);

            if (publishMessage != null)
            {
                Subscribers.AsParallel().ForAll(s =&gt; s.Send(publishMessage));
            }

    }
</code></pre>

<p>I am just trying to verify if I am passing this object around correctly</p>
