Exemplo n.º 1
0
 public AuthenticationManager(
     IIdentityService identityService,
     IIdentityStorage storage)
 {
     this.identityService = identityService;
     this.storage         = storage;
 }
 public Handler(IUserRoleService <ApplicationUser, ApplicationRole> userRoleService,
                IIdentityStorage <ApplicationUser, string> userStorage, IMapper mapper)
 {
     _userRoleService = userRoleService;
     _userStorage     = userStorage;
     _mapper          = mapper;
 }
Exemplo n.º 3
0
 public Handler(IXNewsDbContext context, IMapper mapper,
                IIdentityStorage <ApplicationUser, string> userStorage)
 {
     _context     = context;
     _mapper      = mapper;
     _userStorage = userStorage;
 }
Exemplo n.º 4
0
 public GeneEditorService(IUnitOfWork unitOfWork, ICodonOptimizationService codonOptimizationService,
                          IGeneFragmentationService geneFragmentationService, IIdentityStorage identityStorage)
 {
     this.unitOfWork = unitOfWork;
     this.codonOptimizationService = codonOptimizationService;
     this.geneFragmentationService = geneFragmentationService;
     this.identityStorage          = identityStorage;
 }
Exemplo n.º 5
0
 public Handler(IIdentityStorage <ApplicationUser, string> userStorage,
                IIdentityStorage <ApplicationRole, string> roleStorage,
                IUserRoleService <ApplicationUser, ApplicationRole> userRoleService)
 {
     _userStorage     = userStorage;
     _roleStorage     = roleStorage;
     _userRoleService = userRoleService;
 }
Exemplo n.º 6
0
        protected IdentityStorageTests(
            Func <string, IIdentityStorage> storageFactory,
            ITestOutputHelper testOutputHelper
            )
        {
            _testOutputHelper = testOutputHelper;
            var clusterName = $"test-{Guid.NewGuid().ToString("N").Substring(0, 6)}";

            _storage          = storageFactory(clusterName);
            _storageInstance2 = storageFactory(clusterName);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Throws <see cref="NotFoundException"/> if the item with the specified <paramref name="id"/> doesn't exist.
        /// </summary>
        public static async Task ThrowIfDoesNotExistAsync <TItem, TItemId>(this IIdentityStorage <TItem, TItemId> storage,
                                                                           TItemId id) where TItem : class
        {
            bool itemExists = await storage.Exists(id)
                              .ConfigureAwait(false);

            if (!itemExists)
            {
                throw new NotFoundException(typeof(TItem).Name, id);
            }
        }
Exemplo n.º 8
0
 public IdentityService(IIdentityAccessor claimsPrincipalAccessor,
                        IIdentityStorage identityStorage,
                        IIdentityAttributeStorage identityAttributeStorage,
                        ILogger <IdentityService> log,
                        IHttpContextAccessor httpContextAccessor)
 {
     _claimsPrincipalAccessor  = claimsPrincipalAccessor;
     _identityStorage          = identityStorage;
     _identityAttributeStorage = identityAttributeStorage;
     _httpContextAccessor      = httpContextAccessor;
     _log = log;
 }
        /// <summary>
        /// Checks if the <paramref name="storage"/> contains an item with the specified <paramref name="id"/>.
        /// </summary>
        public static async Task <bool> Exists <TItem, TItemId>
        (
            this IIdentityStorage <TItem, TItemId> storage,
            TItemId id
        )
            where TItem : class
        {
            TItem item = await storage.FindByIdAsync(id)
                         .ConfigureAwait(false);

            return(item != null);
        }
Exemplo n.º 10
0
 public IdentityService(IIdentityAccessor claimsPrincipalAccessor,
                        IdentityOptions identityOptions,
                        IIdentityStorage identityStorage,
                        ILocalAccountService localAccountService,
                        ILogger <IdentityService> log,
                        IHttpContextAccessor httpContextAccessor)
 {
     _claimsPrincipalAccessor = claimsPrincipalAccessor;
     _identityOptions         = identityOptions;
     _identityStorage         = identityStorage;
     _localAccountService     = localAccountService;
     _httpContextAccessor     = httpContextAccessor;
     _log = log;
 }
Exemplo n.º 11
0
        public CreatePostCommandValidators(IXNewsDbContext context,
                                           IIdentityStorage <ApplicationUser, string> userStorage)
        {
            RuleFor(c => c.Content)
            .NotEmpty()
            .Length(PostValidationOptions.ContentMinLength, PostValidationOptions.ContentMaxLength);

            RuleFor(c => c.Title)
            .NotEmpty()
            .Length(PostValidationOptions.TitleMinLength, PostValidationOptions.TitleMaxLength)
            .UniqueInsideOfDbSetColumn(context.Post, p => p.Title);

            RuleFor(c => c.UserId)
            .NotEmpty();
        }
        public void ReadTeamsAndSchools( )
        {
            Schools.Clear( );
            Teams.Clear( );
            Athletes.Clear( );

            doc.Load(FilePath);

            foreach (XmlElement teams in doc.SelectSingleNode("EntryForm").SelectSingleNode("Teams").ChildNodes)
            {
                IIdentityStorage t = new IIdentityStorage();

                t.ShortName = teams.InnerText;

                t.item      = FileIO.FConnFile.GetFileDetails( ).IO.GetAll <DM.Team> ( ).Where(te => te.ShortName.Trim( ) == t.ShortName.Trim( )).FirstOrDefault( );
                t.processor = this;
                Teams.Add(t);
            }

            foreach (XmlElement school in doc.SelectSingleNode("EntryForm").SelectSingleNode("Schools").ChildNodes)
            {
                IIdentityStorage t = new IIdentityStorage();

                t.ShortName = school.InnerText;

                t.item = FileIO.FConnFile.GetFileDetails( ).IO.GetAll <DM.School> ( ).Where(te => te.ShortName.Trim() == t.ShortName.Trim()).FirstOrDefault( );

                t.isSchool  = true;
                t.processor = this;
                Schools.Add(t);
            }

            foreach (XmlElement athlete in doc.SelectSingleNode("EntryForm").SelectSingleNode("Entries").ChildNodes)
            {
                try
                {
                    AthleteStorage a = new AthleteStorage();

                    a.Name        = athlete.Attributes["Name"].Value.ToString( ).Replace("  ", " ");
                    a.DateOfBirth = DateTime.Parse(athlete.Attributes["DateOfBirth"].Value);

                    a.School = FileIO.FConnFile.GetFileDetails( ).IO.GetAll <DM.School> ( ).Where(te => te.ShortName.Trim( ) == athlete.Attributes["SchoolCode"].Value.Trim( )).FirstOrDefault( );
                    a.Team   = FileIO.FConnFile.GetFileDetails( ).IO.GetAll <DM.Team> ( ).Where(te => te.ShortName.Trim( ) == athlete.Attributes["TeamCode"].Value.Trim( )).FirstOrDefault( );

                    if (athlete.Attributes["GlobalID"].Value != "")
                    {
                        a.GlobalID = int.Parse(athlete.Attributes["GlobalID"].Value);
                    }

                    if (athlete.Attributes["CategoryCode"].Value.Contains("B"))
                    {
                        a.Gender = DM.Gender.Male;
                    }
                    else
                    {
                        a.Gender = DM.Gender.Female;
                    }

                    a.EventCodes = new List <string> ( );

                    if (athlete.SelectSingleNode("Events").HasChildNodes)
                    {
                        foreach (XmlElement ev in athlete.SelectSingleNode("Events").ChildNodes)
                        {
                            a.EventCodes.Add(ev.Attributes["EventCode"].Value);
                        }
                    }

                    Athletes.Add(a);

                    Console.WriteLine("Athlete Read: " + a.Name);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Failed to read " + athlete.Attributes["Name"].Value.ToString( ) + "\n" + ex.Message);
                    continue;
                }
            }

            Wizard.changeHappend( );
        }
Exemplo n.º 13
0
 public Handler(IIdentityStorage <ApplicationRole, string> roleStorage, IMapper mapper)
 {
     _roleStorage = roleStorage;
     _mapper      = mapper;
 }
 public IdentityStorageLogging(IIdentityStorage storage) => _storage = storage;
Exemplo n.º 15
0
 public GeneSynthesizerService(IUnitOfWork unitOfWork, IIdentityStorage identityStorage,
                               IChannelConfigurationService channelConfigurationService)
     : base(unitOfWork, identityStorage)
 {
     this.channelConfigurationService = channelConfigurationService;
 }
Exemplo n.º 16
0
 public Handler(IIdentityStorage <ApplicationRole, string> roleStorage)
 {
     _roleStorage = roleStorage;
 }
Exemplo n.º 17
0
 public ManualControlService(IUnitOfWork unitOfWork, IIdentityStorage identityStorage)
     : base(unitOfWork, identityStorage)
 {
 }
Exemplo n.º 18
0
 public Handler(IIdentityStorage <ApplicationUser, string> userStorage, IMapper mapper)
 {
     _userStorage = userStorage;
     _mapper      = mapper;
 }
Exemplo n.º 19
0
 public GeneController(IUnitOfWork unitOfWork, IIdentityStorage identityStorage)
 {
     this.unitOfWork      = unitOfWork;
     this.identityStorage = identityStorage;
 }
Exemplo n.º 20
0
 public IdentityStorageLookup(IIdentityStorage storage) => Storage = storage;
Exemplo n.º 21
0
 public Handler(IJwtService <ApplicationUser, string, RefreshToken> jwtService,
                IIdentityStorage <ApplicationUser, string> userStorage)
 {
     _jwtService  = jwtService;
     _userStorage = userStorage;
 }
Exemplo n.º 22
0
 public DefaultAuthenticationManager(IIdentiryFactory identityFactory, IIdentityStorage identityStorage)
 {
     _identityFactory = identityFactory;
     _identityStorage = identityStorage;
 }
Exemplo n.º 23
0
 public Handler(IIdentityStorage <ApplicationUser, string> userStorage)
 {
     _userStorage = userStorage;
 }
Exemplo n.º 24
0
 protected BaseService(IUnitOfWork unitOfWork, IIdentityStorage identityStorage)
 {
     this.unitOfWork      = unitOfWork;
     this.identityStorage = identityStorage;
 }
 public Handler(IIdentityStorage <ApplicationUser, string> userStorage,
                IUserPasswordService <ApplicationUser, string> userPasswordService)
 {
     _userStorage         = userStorage;
     _userPasswordService = userPasswordService;
 }
Exemplo n.º 26
0
 public CycleEditorService(IUnitOfWork unitOfWork, IIdentityStorage identityStorage)
 {
     this.unitOfWork      = unitOfWork;
     this.identityStorage = identityStorage;
 }
Exemplo n.º 27
0
 public KatastralgemeindenController(IUnitOfWork unitOfWork, IIdentityStorage identityStorage)
 {
     UnitOfWork           = unitOfWork;
     this.identityStorage = identityStorage;
 }
Exemplo n.º 28
0
 public GeneOrderService(IUnitOfWork unitOfWork, IIdentityStorage identityStorage)
 {
     this.unitOfWork      = unitOfWork;
     this.identityStorage = identityStorage;
 }
Exemplo n.º 29
0
 public ChannelConfigurationService(IUnitOfWork unitOfWork, IIdentityStorage identityStorage)
     : base(unitOfWork, identityStorage)
 {
 }