public IEntity Create(int?id = null) { if (!id.HasValue) { id = _identityGenerator.GenerateId(); } return(new Entity(id.Value, _eventSystem)); }
public async Task <Customer> AddCustomer(Customer customer) { customer.Id = _identityGenerator.GenerateId(); await _customerContext.Customers.AddAsync(customer); await _customerContext.SaveChangesAsync(); return(customer); }
public Key GenerateId(Type type) { return(new ShortGuidKey((string)_identityGenerator.GenerateId())); }