public async Task <long> CreateAsync(ShapeDto request) { request.ThrowIfNull(nameof(request)); request.ThrowIfInvalid(); var shape = request.NewShapeOrThrowIfInvalid(); var entity = await _context.AddEntityAsync(shape); await _context.SaveChangesAsync(); return(entity.Id); }