忽略dll文件git
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
namespace Hncore.Infrastructure.DDD
|
||||
{
|
||||
public abstract class AggregateRoot<TId> : Entity<TId>, IAggregateRoot<TId>
|
||||
{
|
||||
public AggregateRoot()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace Hncore.Infrastructure.DDD
|
||||
{
|
||||
/// <summary>
|
||||
/// 实现模型抽象基类
|
||||
/// </summary>
|
||||
/// <typeparam name="TId">主键数据类型</typeparam>
|
||||
public abstract class Entity<TId> : IEntity<TId>
|
||||
{
|
||||
/// <summary>
|
||||
/// 记录数据库主键ID
|
||||
/// </summary>
|
||||
[JsonProperty("Id")]
|
||||
public virtual TId Id { get; set; }
|
||||
}
|
||||
|
||||
public abstract class EntityWithTime<TId> : Entity<TId>
|
||||
{
|
||||
/// <summary>
|
||||
/// 记录添加(创建)时间
|
||||
/// </summary>
|
||||
public virtual DateTime CreateTime { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 记录最后更新时间
|
||||
/// </summary>
|
||||
public virtual DateTime UpdateTime { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 记录软删除标记,0.代表正常,1.代表已删除
|
||||
/// </summary>
|
||||
public virtual int DeleteTag { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public abstract class EntityWithDelete<TId> : Entity<TId>,ISoftDelete
|
||||
{
|
||||
/// <summary>
|
||||
/// 记录软删除标记,0.代表正常,1.代表已删除
|
||||
/// </summary>
|
||||
public virtual int DeleteTag { get; set; } = 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Hncore.Infrastructure.DDD
|
||||
{
|
||||
public interface IAggregateRoot<TId> : IEntity<TId>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Hncore.Infrastructure.DDD
|
||||
{
|
||||
public interface IEntity
|
||||
{
|
||||
|
||||
}
|
||||
public interface IEntity<TId>: IEntity
|
||||
{
|
||||
TId Id
|
||||
{
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Hncore.Infrastructure.DDD
|
||||
{
|
||||
public interface IQuery<TEntity,TId> where TEntity : IEntity<TId>
|
||||
{
|
||||
TEntity GetOne(Expression<Func<TEntity, bool>> condition);
|
||||
|
||||
Task<TEntity> GetOneAsync(Expression<Func<TEntity, bool>> condition);
|
||||
|
||||
PageData<TEntity> GetList(Expression<Func<TEntity, bool>> condition, int pagesize, int pageindex, bool istotal);
|
||||
|
||||
Task<PageData<TEntity>> GetListAsync(Expression<Func<TEntity, bool>> condition, int pagesize, int pageindex, bool istotal);
|
||||
|
||||
List<TEntity> GetList(Expression<Func<TEntity, bool>> condition);
|
||||
|
||||
Task<List<TEntity>> GetListAsync(Expression<Func<TEntity, bool>> condition);
|
||||
|
||||
bool Exists(Expression<Func<TEntity, bool>> condition);
|
||||
|
||||
Task<bool> ExistsAsync(Expression<Func<TEntity, bool>> condition);
|
||||
|
||||
List<TEntity> TopN(Expression<Func<TEntity, bool>> condition, int topN);
|
||||
|
||||
Task<List<TEntity>> TopNAsync(Expression<Func<TEntity, bool>> condition, int topN);
|
||||
|
||||
IQueryable<TEntity> GetListQueryable(Expression<Func<TEntity, bool>> condition);
|
||||
|
||||
IQueryable<TEntity> GetQueryable();
|
||||
|
||||
DbContext DbContext();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Hncore.Infrastructure.DDD
|
||||
{
|
||||
public interface IRepository<TEntity, TId> where TEntity : IEntity<TId>
|
||||
{
|
||||
TEntity FindById(TId id);
|
||||
|
||||
Task<TEntity> FindByIdAsync(TId id);
|
||||
|
||||
void Add(TEntity entity);
|
||||
|
||||
Task AddAsync(TEntity entity);
|
||||
/// <summary>
|
||||
/// 批量添加
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
void AddRange(List<TEntity> entity);
|
||||
/// <summary>
|
||||
/// 批量添加
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
Task AddRangeAsync(List<TEntity> entity);
|
||||
/// <summary>
|
||||
/// 批量修改
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
void UpdateRange(List<TEntity> entity);
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
void RemoveRange(List<TEntity> entity);
|
||||
|
||||
void Remove(TEntity entity);
|
||||
void Update(TEntity entity);
|
||||
|
||||
|
||||
IQueryable<TEntity> GetQueryable();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace Hncore.Infrastructure.DDD
|
||||
{
|
||||
public interface ISoftDelete
|
||||
{
|
||||
int DeleteTag { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace Hncore.Infrastructure.DDD
|
||||
{
|
||||
public interface ITenant
|
||||
{
|
||||
int TenantId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace Hncore.Infrastructure.DDD
|
||||
{
|
||||
public interface ITenantStore
|
||||
{
|
||||
int StoreId { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user