public async Task <Contact> CreateAsync(Contact element)
        {
            var entity = new ContactEntity();

            FromDtoToEntity(element, entity);

            using (_metrics.Write())
            {
                await _context.Contacts.AddAsync(entity);

                await _context.SaveChangesAsync();
            }

            _logger.LogDebug("Created new contact {0}", entity.Id);
            return(new Contact {
                Id = entity.Id, FirstName = element.FirstName, LastName = element.LastName
            });
        }
 private static void FromDtoToEntity(Contact dto, ContactEntity entity)
 {
     entity.FirstName = dto.FirstName;
     entity.LastName  = dto.LastName;
 }