Example #1
0
        /// <summary>
        /// 添加租户
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <bool> AddTerant(TerantInput input)
        {
            var entity = Mapper.Map <Terant>(input);

            entity.Effective = 3;
            await UnitOfWork.GetRepository <Terant>().InsertAsync(entity);

            try
            {
                UnitOfWork.Commit();
            }
            catch (Exception e)
            {
                Logger.LogError(e.ToString());
                UnitOfWork.Rollback();
                return(false);
            }
            return(true);
        }
Example #2
0
 public async Task <IActionResult> CreateTerant([FromBody] TerantInput input)
 {
     return(Ok(await _commonService.AddTerant(input)));
 }