# Ask Pattern with Shard Region

**URL:** <https://discuss.akka.io/t/ask-pattern-with-shard-region/6302>\
**Category:** Akka Cluster\
**Created:** [April 19, 2020, 2:10pm UTC](https://discuss.akka.io/t/ask-pattern-with-shard-region/6302 "2020-04-19T14:10:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alan.brewster73](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@alan.brewster73](https://discuss.akka.io/u/alan.brewster73)\
**Post date:** [April 19, 2020, 2:10pm UTC](https://discuss.akka.io/t/ask-pattern-with-shard-region/6302/1 "2020-04-19T14:10:26Z")

</div>

Hi,

How do I do an ask with a Shard Region? Currently, I am asking the entity reference directly as shown below.

```auto
val sharding = ClusterSharding(system)
val shardRegion = sharding.init(Entity(ShoppingCartActor.TypeKey)(createBehavior = entityContext => ShoppingCartActor()))

def addItem(id: String, quantity: Int) : Future[CartState] = {
  val entityRef = sharding.entityRefFor(ShoppingCartActor.TypeKey, "Cart")
  entityRef ? (ShoppingCartActor.AddItem(id, quantity, _))
}

```

Kind regards
