Esempio n. 1
0
        public T AddEntity(T entity)
        {
            var model = baseRepository.AddEntity(entity);

            DBSession.SaveChanges();

            return(model);
        }
Esempio n. 2
0
        public T AddEntity(T entity)
        {
            //调用T对应的仓储来做添加工作
            var addEntity = currentRepository.AddEntity(entity);

            dbSession.SaveChanges();
            return(addEntity);
        }
Esempio n. 3
0
        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());
        }
Esempio n. 4
0
 /// <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);
 }
Esempio n. 7
0
 public T AddEntity(T entity)
 {
     return(_baseRepository.AddEntity(entity));
 }
Esempio n. 8
0
 public async Task <ApiResponseWrapper> AddEntity(TEntity entityObject)
 {
     return(await _service.AddEntity(entityObject));
 }
Esempio n. 9
0
        public int AddEntity(T entity)
        {
            var backEntity = CurrentRepository.AddEntity(entity);

            return(DbSession.SaveChange());
        }
Esempio n. 10
0
 /// <summary>
 /// 添加实体模型
 /// </summary>
 /// <param name="Entity">实体模型</param>
 /// <returns>是否添加成功</returns>
 public bool AddEntity(T Entity)
 {
     return(baseRepository.AddEntity(Entity));
 }
Esempio n. 11
0
        /// <summary>
        /// 创建数据会话实例
        /// </summary>

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        public T AddEntity(T entity)
        {
            return(baseDal.AddEntity(entity));
        }