Ejemplo n.º 1
0
        public void Update(string taxJson, string ownerId)
        {
            Taxes tax = Newtonsoft.Json.JsonConvert.DeserializeObject <Taxes>(taxJson);

            tax.OwnerId = ownerId;
            _collections.Save(tax);
            if (_bus != null)
            {
                _bus.Publish(new TaxUpdated {
                    TaxUpdatedJson = tax.ToJson()
                });
            }
        }
Ejemplo n.º 2
0
        public Taxes Create(string taxJson, string ownerId)
        {
            Taxes tax = Newtonsoft.Json.JsonConvert.DeserializeObject <Taxes>(taxJson);

            tax.OwnerId = ownerId;
            tax._id     = Guid.NewGuid();
            _collections.Save(tax);

            if (_bus != null)
            {
                _bus.Publish(new TaxCreated {
                    TaxJson = tax.ToJson()
                });
            }
            return(tax);
        }