コード例 #1
0
        public IBusinessException When(Func <T, bool> func)
        {
            if (func(Value))
            {
                busEx.Add("", "");
            }

            return(busEx);
        }
コード例 #2
0
ファイル: ResolveUser.cs プロジェクト: atul221282/SpecialApp
        /// <summary>
        /// This method must be wrapped under transaction
        /// </summary>
        /// <param name="email"></param>
        /// <param name="busEx"></param>
        /// <returns></returns>
        public async Task <IdentityResult> DeleteUsers(string email, IBusinessException busEx)
        {
            if (userResultType is UnauthorisedUser || userResultType is AnonymousUser)
            {
                busEx.Add("SpecialAppUsers", $"No user found for {email}");
            }

            busEx.ThrowIfErrors();

            var repo = uow.GetRepository <Users>();

            var users = await repo.GetAll().GetActive().FirstOrDefaultAsync(x => x.SpecialAppUsersId == userResultType.Id);

            if (users == null)
            {
                busEx.Add("Users", $"No user found for {email}");
            }

            busEx.ThrowIfErrors();

            await repo.Delete(users);

            return(await usrMngService.DeleteAsync((SpecialAppUsers)userResultType));
        }
コード例 #3
0
        public async Task <IResolvedUser> GetUser(string email)
        {
            if (string.IsNullOrEmpty(email))
            {
                busEx.Add("SpecialAppUsers", "Email is required to find the user");
            }

            busEx.ThrowIfErrors();

            var result = await Service.GetUser(email);

            userResultType = result;

            return(GetResolveUser());
        }