예제 #1
0
        public static ApplicationUserProfileRefRepository GetApplicationUserProfileRefRepository(IUnitOfWork unitOfWork)
        {
            var repository = new ApplicationUserProfileRefRepository();

            repository.UnitOfWork = unitOfWork;
            return(repository);
        }
        public ApplicationUser FindByEmail(string email)
        {
            var currentLoginedUser = getCurrentLoginedUser();

            try
            {
                IQueryable <ApplicationUser> queryset = ObjectSet.Include(i => i.ApplicationUserProfileRef);

                var result = from q in ApplicationUserProfileRefRepository.All()
                             where q.ApplicationUserProfile.EMail.Equals(email, StringComparison.InvariantCultureIgnoreCase) &&
                             q.Void == false
                             select q.ApplicationUser;

                ApplicationUser founduser = result.SingleOrDefault();

                return(founduser);
            }
            catch (Exception ex)
            {
                WriteErrorLog(ex);
                Task.Run(() => WriteUserOperationLogAsync(OperationCodeEnum.Account_FindByEmail_End_Fail, currentLoginedUser));
                throw ex;
            }
        }