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)); }
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); }
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 }
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()))); }
public Language AddLanguage(string code, string name) { return(context.New <Language>().With(code, name)); }
IAccountInfo IAccountManagerService.CreateAccount(string displayName, Email email) { return(context.New <Account>().With(displayName, email)); }