public async Task <Guid> CreateVersion(Guid productId, string version) { return(await unitOfWork.RunInTransactionAsync(async() => { var product = await licenseRepository.GetProduct(productId); var entity = new ProductVersionEntity { Active = true, Product = product, Name = version, }; await licenseRepository.CreateVersion(entity); product.Versions.Add(entity); await licenseRepository.UpdateProduct(product); return entity.Id; })); }
internal async Task CreateVersion(ProductVersionEntity entity) { await CreateAsync(entity); }