Entity framework doesn't support nested transactions, so how can nested services update data with a failsafe such is a transaction?

Scenario: A has 1-to-\* relationship with B. By default B needs to be created when A is created, but A is not a required field.

\*\*
Service A
\*\*

```
public void CreateA(A a)
{

    using (var transaction = _context.Database.BeginTransaction())
    {
        _context.Alist.Add(a);

        try
        {
            _context.SaveChanges();
        }
        catch (Exception ex)
        {
            transaction.Rollback();
            throw ex;
        }

        try
        {
            var newB = new B
            {
                AId = a.Id,
                Name = "Default"
            };
            Bservice.Create(newB);
        }
        catch (Exception ex)
        {
            transaction.Rollback();
            throw ex;
        }

        transaction.Commit();
    }
}

```

\*\*
Service B
\*\*

```
public void CreateB(B b)
{
    _context.Blist.Add(b);

    try
    {
        _context.SaveChanges();
    }
    catch (Exception ex)
    {
        throw ex;
    }
}

```

This works perfectly well as expected, however, new requirement comes in: C table needs to be implemented and has \*-to-1 relationship with B. By default C needs to be created when B is created. User can create B without creating A, and C without creating B or A.

So, naturally, as C is the lowest level, can be created by itself and live on it's own, code base can be as simple as:

```
public void CreateC(C c)
{
    _context.Clist.Add(c);

    try
    {
        _context.SaveChanges();
    }
    catch (Exception ex)
    {
        throw ex;
    }
}

```

So the question is, what becomes of B? If B is being created, then it should look exactly as A, creating B and a default C through a transaction. However, this would not work if the method is called through A service due to nested transactions issue. Alternatively, leaving it as is and just adding creation of C is incorrect since if B is being created by itself as it will not catch an exception if thrown in the C service. Is the only way to achieve this is to have 2 separate methods for deletion with and without a transaction? Passing down a transaction is also not an option, as a very least it makes code extremely ugly.

This simple example should portray the issue.

Looking forward to suggestions.

Please let me know if more information is required.