Exemple #1
0
        public async Task SetOwner(ICustomerGrain customer)
        {
            if (customer == null)
            {
                throw new ArgumentNullException("customer");
            }

            State.Owner = customer;

            await WriteStateAsync();
        }
Exemple #2
0
        public async Task AddCustomer(ICustomerGrain newCustomer)
        {
            if (State.AllCustomerGrains.Any(e =>
                                            e.GetGrainIdentity() == newCustomer.GetGrainIdentity()
                                            ))
            {
                return;
            }


            State.AllCustomerGrains.Add(newCustomer);
            await WriteStateAsync();

            return;
        }