Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Transactions Using Net Core and Repository Pattern (ADO .NET)

$
0
0

Hello, I have a "webapi" in "Net Core" and I am using "Ado net" and "repository pattern".

My question is, if the repository is

public interface IRepository<T> where T : BaseEntity
    {
        int Add(T item);
        void Remove(int id);
        int Update(T item);
        T FindById(int id);
        IEnumerable<T> FindAll();
        //IEnumerable<T> FindAll(T item);
    }

How can I have a transaction between the methods?

I want to have a transaction where it's called

Int Add (object1 item);

Int Add (object2 item);

Commit ();

I see that transactionscope is not for net core, how can I solve that case?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>