public BaseRepository(IBaseDbContext context, UnitOfWork ufw, int mid) { this.Context = context; this.MemberId = mid; this.UFW = ufw; this.DbSet = Context.Set <TEntity>(); }
public PartnerManager(IBaseDbContext baseDbContext) { if (baseDbContext == null) { throw new ArgumentNullException("baseDbContext"); } BaseDbContext = baseDbContext; }
public static EntityEntry <E> UpdateDefault <E>(this IBaseDbContext dbContext, E entity, Action <E> patchAction) where E : class { EntityEntry <E> entry; dbContext.TryAttach(entity, out entry); patchAction(entity); return(entry); }
public WhutService(IAccountManager <AppUser> manager, IBaseDbContext <EotDbModel> eotDb, IBaseDbContext <RinkDbModel> rinkDb, IBaseDbContext <ScoresDbModel> scoresDb, IBaseDbContext <TableDbModel> tableDb) { _manager = manager; _eotDb = eotDb; _rinkDb = rinkDb; _scoresDb = scoresDb; _tableDb = tableDb; }
public static async Task <EntityEntry <E> > UpdateAsyncDefault <E>(this IBaseDbContext dbContext, E entity, Func <E, Task> patchAction) where E : class { EntityEntry <E> entry; dbContext.TryAttach(entity, out entry); await patchAction(entity); return(entry); }
public static T FindOrCreate <T>(this IBaseDbContext <T> dbContext, string uid) where T : IBaseDbModel, new() { var data = dbContext.Find(uid); if (data == null) { data = new T { Uid = uid }; dbContext.Add(data); } return(data); }
public static EntityEntry <E> UpdateDefault <E>(this IBaseDbContext dbContext, E entity, params Expression <Func <E, object> >[] changedProperties) where E : class { EntityEntry <E> entry; dbContext.TryAttach(entity, out entry); if (changedProperties?.Any() == true) { foreach (var property in changedProperties) { entry.Property(property).IsModified = true; } } else { return(dbContext.Update(entity)); } return(entry); }
public GenericAuditableRepository(IBaseDbContext context) { _context = context; }
public IBaseDbContext Get() { return _baseDbContext ?? (_baseDbContext = new SwimDbBaseDbContext()); }
public Repository(IBaseDbContext dbContext) : base(dbContext) { }
/// <summary> /// 构造函数 /// </summary> /// <param name="context">上下文对象</param> public Repository(IBaseDbContext context) => _currentContext = context;
public static Task <IDbContextTransaction> BeginTransactionAsyncDefault(this IBaseDbContext dbContext, CancellationToken cancellationToken = default) { return(dbContext.Database.BeginTransactionAsync(cancellationToken)); }
public static bool IsSoftDeleteAppliedForEntityDefault(this IBaseDbContext dbContext, Type eType) { return(typeof(ISoftDeleteEntity).IsAssignableFrom(eType) && dbContext.IsFilterAppliedForEntity(QueryFilterConsts.SoftDeleteDefaultName, eType)); }
/// <summary> /// Get table name /// </summary> /// <typeparam name="T"></typeparam> /// <param name="context"></param> /// <returns></returns> public static string GetTableName <T>(this IBaseDbContext context) where T : class { ObjectContext objectContext = ((IObjectContextAdapter)context).ObjectContext; return(objectContext.GetTableName <T>()); }
public static T FindOrCreate <T>(this IBaseDbContext <T> dbContext, AppUser user) where T : IBaseDbModel, new() { return(FindOrCreate(dbContext, user.Uid)); }
public BaseEntityCollection(IBaseDbContext dbContext, string name) { this.DbContext = dbContext; this.Name = name; }
public PartnerManager(IBaseDbContext baseDbContext) { _baseDbContext = baseDbContext ?? throw new ArgumentNullException(nameof(baseDbContext)); }
public CommandRequestHandler(IBaseDbContext context) { _context = context; }
/// <summary> /// Set <c>Dbcontext</c> for repository /// </summary> /// <param name="dbContext"></param> public BaseRepository(IBaseDbContext dbContext) { _dbContext = dbContext; }
public Repository(IBaseDbContext DbsetContext) { _DbsetContext = DbsetContext; }
protected Repository(IBaseDbContext dbContext) { DbContext = dbContext; }
public static bool IsSoftDeleteEnabledDefault(this IBaseDbContext dbContext) { return(dbContext.IsFilterEnabled(QueryFilterConsts.SoftDeleteDefaultName)); }
public Repository(IBaseDbContext context, UnitOfWork ufw, int mid) : base(context, ufw, mid) { }
public BaseRepository(IBaseDbContext baseDbContext) { _baseDbContext = baseDbContext; }
protected EntityStringRepository(IBaseDbContext dbContext) : base(dbContext) { }
public UnitOfWork(IBaseDbContext context, IBaseDbContext contextlog) { _Context = context; _ContextLog = contextlog; }