Пример #1
0
        public IEntity Create(int?id = null)
        {
            if (!id.HasValue)
            {
                id = _identityGenerator.GenerateId();
            }

            return(new Entity(id.Value, _eventSystem));
        }
Пример #2
0
        public async Task <Customer> AddCustomer(Customer customer)
        {
            customer.Id = _identityGenerator.GenerateId();

            await _customerContext.Customers.AddAsync(customer);

            await _customerContext.SaveChangesAsync();

            return(customer);
        }
Пример #3
0
 public Key GenerateId(Type type)
 {
     return(new ShortGuidKey((string)_identityGenerator.GenerateId()));
 }