public T AddEntity(T entity) { var model = baseRepository.AddEntity(entity); DBSession.SaveChanges(); return(model); }
public T AddEntity(T entity) { //调用T对应的仓储来做添加工作 var addEntity = currentRepository.AddEntity(entity); dbSession.SaveChanges(); return(addEntity); }
protected async override Task ProcessMessage(Message message, CancellationToken token) { // Process the message Console.WriteLine($"Received message: SequenceNumber:{message.SystemProperties.SequenceNumber} Body:{Encoding.UTF8.GetString(message.Body)}"); var rowId = Guid.NewGuid().ToString(); //Save message in Azure Table _repository.AddEntity(new DemoEntity { DemoInt = message.SystemProperties.SequenceNumber, PartitionKey = message.PartitionKey, RowKey = rowId, DemoField = Encoding.UTF8.GetString(message.Body) }); var entity = _repository.Get(x => x.RowKey == rowId) .Single(); Console.WriteLine(entity.PartitionKey); _repository.Delete(entity); Console.WriteLine(_repository.Get(x => true).Count()); }
/// <summary> /// /// </summary> /// <param name="t"></param> /// <returns></returns> public virtual int AddEntity(T t) { _repository.AddEntity(t); return(uow.SaveChanges()); }
/// <summary> /// 添加一条记录 /// </summary> /// <param name="entity"></param> /// <returns></returns> public T AddEntity(T entity, bool isSave = false) { return(_baseReposiotry.AddEntity(entity, isSave: isSave)); }
/// <summary> /// 添加 /// </summary> /// <param name="entity">要添加的实体</param> /// <returns></returns> public T AddEntity(T entity) { CurrentRepository.AddEntity(entity); CurrentContext.SaveChanges(); return(entity); }
public T AddEntity(T entity) { return(_baseRepository.AddEntity(entity)); }
public async Task <ApiResponseWrapper> AddEntity(TEntity entityObject) { return(await _service.AddEntity(entityObject)); }
public int AddEntity(T entity) { var backEntity = CurrentRepository.AddEntity(entity); return(DbSession.SaveChange()); }
/// <summary> /// 添加实体模型 /// </summary> /// <param name="Entity">实体模型</param> /// <returns>是否添加成功</returns> public bool AddEntity(T Entity) { return(baseRepository.AddEntity(Entity)); }
/// <summary> /// 创建数据会话实例 /// </summary> /// <summary> /// 添加 /// </summary> /// <param name="entity">实体</param> /// <returns></returns> public T AddEntity(T entity) { return(baseDal.AddEntity(entity)); }