public BusinessOperationResult <bool> ValidatePasswordRecoveryRequest(Guid guidId) { var result = new BusinessOperationResult <bool>(); DynamicLink link = accountContext.DynamicLinks.GetByGuidId(guidId); if (link == null) { result.AddError(BusinessMessageSource.BusinessRule, Resources.DynamicLinkNotFound); } else if (systemContext.DateTimeNow > link.ExpiresOn) { result.AddError(BusinessMessageSource.BusinessRule, Resources.DynamicLinkExpired); } else if (link.IsConsumed) { result.AddError(BusinessMessageSource.BusinessRule, Resources.DynamicLinkConsumed); } else { result.OperationResult = true; } return(result); }
public BusinessOperationResult<User> FindUserByAlias(string alias, bool? isActive = null) { var result = new BusinessOperationResult<User>(); if (string.IsNullOrWhiteSpace(alias)) { result.AddError(BusinessMessageSource.ModelProperty, Resources.InvalidValue); } else { User foundUser = accountContext.Users.FindUserByAlias(alias, isActive); if (foundUser == null) { result.AddError(BusinessMessageSource.BusinessRule, Resources.UserNotFound); } result.OperationResult = foundUser; } return result; }
public BusinessOperationResult <User> FindUserByAlias(string alias, bool?isActive = null) { var result = new BusinessOperationResult <User>(); if (string.IsNullOrWhiteSpace(alias)) { result.AddError(BusinessMessageSource.ModelProperty, Resources.InvalidValue); } else { User foundUser = accountContext.Users.FindUserByAlias(alias, isActive); if (foundUser == null) { result.AddError(BusinessMessageSource.BusinessRule, Resources.UserNotFound); } result.OperationResult = foundUser; } return(result); }
public BusinessOperationResult<bool> ValidatePasswordRecoveryRequest(Guid guidId) { var result = new BusinessOperationResult<bool>(); DynamicLink link = accountContext.DynamicLinks.GetByGuidId(guidId); if (link == null) { result.AddError(BusinessMessageSource.BusinessRule, Resources.DynamicLinkNotFound); } else if(systemContext.DateTimeNow > link.ExpiresOn) { result.AddError(BusinessMessageSource.BusinessRule, Resources.DynamicLinkExpired); } else if (link.IsConsumed) { result.AddError(BusinessMessageSource.BusinessRule, Resources.DynamicLinkConsumed); } else { result.OperationResult = true; } return result; }