public static DbEntityDataBundle GetInstance <TEntity>(int userId, int action, TEntity entity) where TEntity : class, IDbEntity { DbEntityDataBundle dataBundle = new DbEntityDataBundle(); dataBundle.Type = entity.GetType().GetBaseType(); dataBundle.Action = action; dataBundle.UserID = userId; dataBundle.AddParameter(dataBundle.Type, EntityParameterKey, entity); return(dataBundle); }
public static DbEntityDataBundle GetInstance <TEntity>(int userId, int action, List <TEntity> entities) where TEntity : class, IDbEntity { DbEntityDataBundle dataBundle = new DbEntityDataBundle(); dataBundle.Type = typeof(TEntity).GetBaseType(); if (entities.Count > 0) { dataBundle.Type = entities.First().GetType(); } dataBundle.Action = action; dataBundle.UserID = userId; dataBundle.AddParameter(EntitiesParameterKey, entities); return(dataBundle); }