Exemple #1
0
        public async Task CreateRequestForCommandAsync <T>(Guid id)
        {
            var exists = await ExistAsync(id);

            var request = exists ?
                          throw new DomainException($"Request with {id} already exists") :
                                new ClientRequest()
                                {
                                    Id   = id,
                                    Name = typeof(T).Name,
                                    Time = DateTime.UtcNow
                                };

            _context.Add(request);

            await _context.SaveChangesAsync();
        }
Exemple #2
0
 public Category Add(Category entity)
 {
     return(_dbContext.Add(entity).Entity);
 }
 public Collection Add(Collection entity)
 {
     return(_dbContext.Add(entity).Entity);
 }