You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use Transactions in this but there is no such example and implementation. whereas in URF.Net there is an implementation of that ass shown below
using System;
using System.Data;
using Repository.Pattern.Repositories;
using TrackableEntities;
namespace Repository.Pattern.UnitOfWork
{
public interface IUnitOfWork
{
int SaveChanges();
int ExecuteSqlCommand(string sql, params object[] parameters);
IRepository<TEntity> Repository<TEntity>() where TEntity : class, ITrackable;
int? CommandTimeout { get; set; }
void BeginTransaction(IsolationLevel isolationLevel = IsolationLevel.Unspecified);
bool Commit();
void Rollback();
}
}
The text was updated successfully, but these errors were encountered:
@ahmedjalalmalik EF Core gives you a transaction for free when you call SaveChangesAsync, so there is no need to explicitly begin a transaction, unless you wish to alter the default transaction settings (such as timeout or isolation level).
In case you do need to change transaction characteristics, then the best practice is to use System.Transactions, support for which was added in EF Core 2.1.
I am trying to use Transactions in this but there is no such example and implementation. whereas in URF.Net there is an implementation of that ass shown below
The text was updated successfully, but these errors were encountered: