public async Task <Shynee> UpdateShyneeAsync(Shynee shynee)
        {
            await _dbContext.Shynees.FindOneAndReplaceAsync(
                s => s.Id == shynee.Id, shynee);

            return(shynee);
        }
Example #2
0
        public async Task <Shynee> UpdateShyneeAsync(Shynee shynee)
        {
            var shyneeToUpdate = _shyneesStore.Find(s => shynee.Id == s.Id);

            _shyneesStore.Remove(shyneeToUpdate);
            _shyneesStore.Add(shynee);
            return(shynee);
        }
        private static Shynee FakeShynee()
        {
            var shyneeCredentials = FakeShyneeCredentials().Generate();
            var shyneeCoordinates = FakeShyneeCoordinates().Generate();
            var ShyneeSettings    = FakeShyneeSettings().Generate();
            var shyneeProfile     = FakeShyneeProfile().Generate();
            var shynee            = new Shynee(
                shyneeCredentials,
                shyneeCoordinates,
                shyneeProfile,
                ShyneeSettings);

            return(shynee);
        }
Example #4
0
        public async Task <Shynee> CreateShyneeAsync(
            ShyneeCredentials shyneeCredentials,
            ShyneeProfile shyneeProfile)
        {
            if (await _shyneesRepository.IsShyneeExistsAsync(shyneeCredentials.Email))
            {
                throw new ShyneeDuplicateException();
            }
            var shynee = new Shynee(
                shyneeCredentials,
                new ShyneeCoordinates(),
                shyneeProfile,
                new ShyneeSettings());
            var id = await _shyneesRepository.CreateShyneeAsync(shynee);

            var createdShynee = await _shyneesRepository.GetShyneeAsync(id);

            return(createdShynee);
        }
        private static Shynee GetStaticShynee()
        {
            var shyneeCredentials = new ShyneeCredentials("*****@*****.**", Hasher.HashPassword("qwertyui"));
            var shyneeCoordinates = FakeShyneeCoordinates().Generate();
            var ShyneeSettings    = new ShyneeSettings();
            var shyneeProfile     = new ShyneeProfile(
                new ShyneeProfileParameter <string>(ShyneeProfileParameterStatus.Visible, "Shynee"),
                new ShyneeProfileParameter <string>(ShyneeProfileParameterStatus.Empty),
                new ShyneeProfileParameter <string>(ShyneeProfileParameterStatus.Empty),
                new ShyneeProfileParameter <DateTime?>(ShyneeProfileParameterStatus.Empty),
                new ShyneeProfileParameter <Gender>(ShyneeProfileParameterStatus.Empty),
                new ShyneeProfileParameter <string[]>(ShyneeProfileParameterStatus.Empty),
                new ShyneeProfileParameter <string>(ShyneeProfileParameterStatus.Empty));
            var shynee = new Shynee(
                new Guid("452B5C13-E964-499C-89D4-072EEC43E7A4"),
                shyneeCredentials,
                shyneeCoordinates,
                shyneeProfile,
                ShyneeSettings);

            return(shynee);
        }
Example #6
0
 public async Task <Guid> CreateShyneeAsync(Shynee shynee)
 {
     _shyneesStore.Add(shynee);
     return(shynee.Id);
 }
        public async Task <Guid> CreateShyneeAsync(Shynee shynee)
        {
            await _dbContext.Shynees.InsertOneAsync(shynee);

            return(shynee.Id);
        }