public async Task <(bool, int)> AddAsync(ProductStruct productStruct) { EntityEntry <ProductsEntity> pe = await context.Products.AddAsync(new ProductsEntity { Name = productStruct.Name, Description = productStruct.Description, }); try { return((await context.SaveChangesAsync()) > 0, pe.Entity.Id); } catch (DbUpdateException dbe) { throw new ExistsInDBException(ExceptionMessages.CannotAddProduct(), dbe); } }