CustomerStore.cs 708 B

1234567891011121314151617181920212223
  1. using System;
  2. using Comal.Classes;
  3. namespace Comal.Stores
  4. {
  5. public class CustomerStore : SchedulableStore<Customer>
  6. {
  7. protected override void BeforeSave(Customer entity)
  8. {
  9. base.BeforeSave(entity);
  10. StoreUtils.Geocode(entity.Delivery);
  11. StoreUtils.Geocode(entity.Postal);
  12. //UpdateAggregate<Customer>(entity, entity.Account, Count<Customer>(x => x.Sites));
  13. }
  14. protected override void BeforeDelete(Customer entity)
  15. {
  16. base.BeforeDelete(entity);
  17. entity.Account.ID = Guid.Empty;
  18. //UpdateAggregate<Customer>(entity, entity.Account, Count<Customer>(x => x.Sites));
  19. }
  20. }
  21. }