示例#1
0
        /// <summary>
        /// 创建
        /// </summary>
        /// <param name="HomeOwerUser"></param>
        /// <returns></returns>
        public virtual async Task CreateAsync(HomeOwerUser entity)
        {
            var exists = await HomeOwerUserRepository.FirstOrDefaultAsync(hu => hu.UserName == entity.UserName);

            if (exists != null)
            {
                throw new UserFriendlyException(string.Format("{0} is exists.", entity.UserName));
            }
            await HomeOwerUserRepository.InsertAsync(entity);
        }
示例#2
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="HomeOwerUser"></param>
 /// <returns></returns>
 public virtual async Task UpdateAsync(HomeOwerUser entity)
 {
     await HomeOwerUserRepository.UpdateAsync(entity);
 }
 public async Task CreateHomeOwerUser(CreateHomeOwerUserInput input)
 {
     var entity = new HomeOwerUser(input.UserName, input.Token);
     await _manager.CreateAsync(entity);
 }