コード例 #1
0
        public Account Register(string displayName, Email email)
        {
            if (displayName == null)
            {
                throw new SecurityException.DisplayNameCannotBeEmpty();
            }
            if (email.IsDefault())
            {
                throw new SecurityException.EmailCannotBeEmpty();
            }

            return(context.New <Account>().With(displayName, email));
        }
コード例 #2
0
        protected internal virtual Event With(string name, string description, List <NewEventAccount> eventAccounts, int target, Date startDate, Date endDate, bool isPrivate)
        {
            Name        = name;
            Description = description;
            Size        = eventAccounts.Count;
            TargetCount = target;
            StartDate   = startDate;
            EndDate     = endDate;
            IsPrivate   = isPrivate;

            repository.Insert(this);

            foreach (var eventAccount in eventAccounts)
            {
                context.New <EventAccount>().With(this, eventAccount);
            }

            return(this);
        }
コード例 #3
0
ファイル: Language.cs プロジェクト: caglayanyildirim/Unity
        protected internal virtual void SetLocalizedText(string key, string text)
        {
            var localizationText = context.Query <LocalizationTexts>().SingleBy(this, key) ??
                                   context.New <LocalizationText>().With(key, text, LanguageCode);

            localizationText.UpdateText(text);

            applicationCache.Remove(this, DICTIONARY);

            GetLocalizedText(key); //set işlemi sonunda tüm cache'i tekrar ayağa kaldırması için eklendi
        }
コード例 #4
0
ファイル: Account.cs プロジェクト: caglayanyildirim/Unity
        protected internal virtual AccountToken CreateToken()
        {
            switch (Status)
            {
            case AccountStatus.Passive:
                throw new SecurityException.AccountIsPassive();

            case AccountStatus.Blocked:
                throw new SecurityException.AccountIsBlocked();
            }

            return(context.New <AccountToken>().With(this, context.System.Now.AddMinutes(commonDataManager.GetAccountTokenExpireMinute())));
        }
コード例 #5
0
 public Language AddLanguage(string code, string name)
 {
     return(context.New <Language>().With(code, name));
 }
コード例 #6
0
 IAccountInfo IAccountManagerService.CreateAccount(string displayName, Email email)
 {
     return(context.New <Account>().With(displayName, email));
 }