예제 #1
0
        /// <summary>
        /// 登入
        /// </summary>
        /// <param name="login"></param>
        /// <returns></returns>
        public virtual LoginEntity Login(LoginEntity login)
        {
            var locker = new LockerEntity
            {
                Name = login.Name,
                Tag  = login.LockerTag
            };

            if (!LockerDomainService.Check(locker))
            {
                login.Errors = login.Errors ?? new List <ErrorInfo>();
                login.Errors.AddList(locker.Errors);
                return(login);
            }
            login = LoginDomainService.Login(login);
            if (login.Errors != null && login.Errors.Count != 0)
            {
                var unitofworks = LockerDomainService.Set(locker);
                if (unitofworks != null)
                {
                    Creator.Get <IContext>().Commit(unitofworks);
                }
            }
            return(login);
        }
예제 #2
0
 public LoginService(IBaseRepository <UserInfo> userRepository, LoginDomainService loginDomainService)
 {
     _userRepository     = userRepository;
     _loginDomainService = loginDomainService;
 }