Exemplo n.º 1
0
        public async Task <Category> GetCategoryWithProducts(int categoryId)
        {
            var spec     = new CategorySpecification(categoryId);
            var category = (await GetAsync(spec)).FirstOrDefault();

            return(category);
        }
Exemplo n.º 2
0
        public async Task <CustomizeViewModel> GetCustomizeItems(int?categoryid, int?catalogItemId)
        {
            var categorySpec = new CategorySpecification();
            var cats         = await _categoryRepository.ListAsync(categorySpec);

            List <CatalogType> productTypes = new List <CatalogType>();

            if (categoryid.HasValue)
            {
                var catalogSpec = new CatalogTypeSpecification(categoryid.Value);
                productTypes = await _catalogTypeRepository.ListAsync(catalogSpec);
            }

            return(new CustomizeViewModel
            {
                CategoryId = categoryid,
                CatalogItemId = catalogItemId,
                Categories = cats.Select(x => (x.Id, x.Name)).ToList(),
                ProductTypes = productTypes.Select(x => new CatalogTypeViewModel
                {
                    Id = x.Id,
                    Code = x.Code,
                    Name = x.Name,
                    PictureUri = _uriComposer.ComposePicUri(x.PictureUri)
                }).ToList()
            });
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,isValued,CategoryId")] CategorySpecification categorySpecification)
        {
            if (id != categorySpecification.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(categorySpecification);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CategorySpecificationExists(categorySpecification.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryId"] = new SelectList(_context.Categories, "Id", "Id", categorySpecification.CategoryId);
            return(View(categorySpecification));
        }
Exemplo n.º 4
0
        private void MovePropertyDown(object sender, RoutedEventArgs e)
        {
            // Moving property down in the datagrid means the index increases

            // Gets the specification
            CategorySpecification catspec = ((FrameworkElement)sender).DataContext as CategorySpecification;

            // Gets the index of the specification
            int index = CategoryModel.CategorySpecifications.ToList().IndexOf(catspec);

            // If the spec is the last one in the list, it can't move down
            if (index < CategoryModel.CategorySpecifications.Count() - 1)
            {
                // Swaps the display order of the swapped specs
                CategoryModel.CategorySpecifications.ToList()[index].DisplayOrder     = index + 1;
                CategoryModel.CategorySpecifications.ToList()[index + 1].DisplayOrder = index;

                // Swaps the 2 specs in the list
                CategoryModel.CategorySpecifications
                    = ListUtilities <CategorySpecification> .Swap
                          (CategoryModel.CategorySpecifications.ToList(), index, index + 1);

                // Refreshes the grid
                BindCategorySpecificationsGrid();
            }
        }
Exemplo n.º 5
0
        private void MovePropertyUp(object sender, RoutedEventArgs e)
        {
            // Moving property up in the datagrid means the index (and display order) decreases

            // Gets the specification
            CategorySpecification spec = ((FrameworkElement)sender).DataContext as CategorySpecification;

            // Gets the index of the specification
            int index = CategoryModel.CategorySpecifications.ToList().IndexOf(spec);

            // If its index is 0, then it can't move up
            if (index > 0)
            {
                // Swaps the display order of the swapped specs
                CategoryModel.CategorySpecifications.ToList()[index].DisplayOrder     = index - 1;
                CategoryModel.CategorySpecifications.ToList()[index - 1].DisplayOrder = index;

                // Swaps the specs in the list
                CategoryModel.CategorySpecifications
                    = ListUtilities <CategorySpecification> .Swap
                          (CategoryModel.CategorySpecifications.ToList(), index, index - 1);

                // Refreshes the category specification grid
                BindCategorySpecificationsGrid();
            }
        }
Exemplo n.º 6
0
        public async Task <IActionResult> Edit(int id = 0)
        {
            if (id != 0)
            {
                var filter   = new CategorySpecification(id);
                var category = await _ICategoryRepository.GetSingleBySpecAsync(filter);

                if (category != null)
                {
                    ViewBag.CountInfluencer = category.AccountCategory.Count();
                    ViewBag.Influencers     = category.AccountCategory;



                    return(View(new CategoryCreateEditModel()
                    {
                        Id = category.Id,
                        Name = category.Name,
                        Published = category.Published,
                        Deleted = category.Deleted
                    }));
                }
                else
                {
                    TempData["MessageError"] = string.Format("{0}", "Lĩnh vực không tồn tại!");
                }
            }

            return(View(new CategoryCreateEditModel()
            {
                Id = 0
            }));
        }
Exemplo n.º 7
0
        public void DeleteCategory(int id)
        {
            var categorySpecification = new CategorySpecification(id);
            var category = _categoryRepository.Query(categorySpecification).First();

            _categoryRepository.Delete(category);
        }
        // GET: CategorySpecifications/Create

        /*public IActionResult Create()
         * {
         *  ViewData["CategoryId"] = new SelectList(_context.Categories, "Id", "Name");
         *  return View();
         * }*/

        public IActionResult Create(int id)
        {
            var x = new CategorySpecification();

            x.CategoryId           = id;
            ViewData["CategoryId"] = _context.Categories.FirstOrDefault(m => m.Id == id).Id;
            return(View(x));
        }
Exemplo n.º 9
0
        public async Task <Category> GetById(int id)
        {
            // Using Specification Pattern
            var spec     = new CategorySpecification(id);
            var category = (await GetAsync(spec)).FirstOrDefault();

            return(category);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Removes the specification from the category
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RemoveSpecification(object sender, RoutedEventArgs e)
        {
            // Gets the specification
            CategorySpecification catspec = ((FrameworkElement)sender).DataContext as CategorySpecification;

            // Remove the specification from the category
            RemoveSelectedSpecFromCategory(catspec);
            // Add the specification back to the selection list
            AddSpecBackToSelectionList(catspec);
        }
Exemplo n.º 11
0
        public IEnumerable <CategoryDto> GetCategorys(string searchString, string category, int pageIndex, int pageSize, out int count)
        {
            CategorySpecification CategoryFilterPaginated = new CategorySpecification(searchString, category, pageIndex, pageSize);
            CategorySpecification CategoryFilter          = new CategorySpecification(searchString, category);

            var Category = _unitOfWork.Category.Find(CategoryFilterPaginated);

            count = _unitOfWork.Category.Count(CategoryFilter);

            return(_mapper.Map <IEnumerable <Category>, IEnumerable <CategoryDto> >(Category));
        }
Exemplo n.º 12
0
        private void AddSpecBackToSelectionList(CategorySpecification catspec)
        {
            // Create a specification and add it to the selection list
            SelectionSpecList.Add(
                new LocalizedSpecification
            {
                SpecificationID = catspec.SpecificationID,
                LookupName      = catspec.SpecificationName
            });

            // Refresh the selection grid
            BindSpecificationSelectionData();
        }
        public async Task <IActionResult> Create([Bind("Id,Name,isValued,CategoryId")] CategorySpecification categorySpecification)
        {
            if (ModelState.IsValid)
            {
                categorySpecification.Id = 0;
                _context.Add(categorySpecification);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index", "Categories"));
            }
            ViewData["CategoryId"] = new SelectList(_context.Categories, "Id", "Id", categorySpecification.CategoryId);
            return(View(categorySpecification));
        }
Exemplo n.º 14
0
            public async Task <Result <ListResponse> > Handle(ListCommand request, CancellationToken cancellationToken)
            {
                var filter          = _mapper.Map <ListCommand, CategoryFilter>(request);
                var catSpec         = new CategorySpecification(filter);
                var totalCategories = await _repository.CountAsync(catSpec, cancellationToken);

                var pageCount  = (int)Math.Ceiling((decimal)totalCategories / request.PaginationOptions.PageSize);
                var categories = await _repository.ListAsync(catSpec, cancellationToken);

                var result = new Result <ListResponse>(new ListResponse(_mapper.Map <IReadOnlyList <CategoryResponse> >(categories), totalCategories, request.PaginationOptions.Page, pageCount));

                return(result);
            }
Exemplo n.º 15
0
            public async Task <Pagination <CategoryDto> > Handle(Query request,
                                                                 CancellationToken cancellationToken)
            {
                var categoryRepository = _unitOfWork.Repository <Category>();

                var categorySpec = new CategorySpecification(request.PaginationParams);

                var categories = await categoryRepository.ListWithSpecificationAsync(categorySpec);

                var count = await categoryRepository.CountAsync(new CategorySpecification());

                var mappedData = _mapper.Map <IReadOnlyList <CategoryDto> >(categories);

                return(new Pagination <CategoryDto>(request.PaginationParams.PageIndex,
                                                    request.PaginationParams.PageSize, count, mappedData));
            }
Exemplo n.º 16
0
        private void RemoveSelectedSpecFromCategory(CategorySpecification catspec)
        {
            // Gets the index of the removed spec
            int removedSpecIndex = CategoryModel.CategorySpecifications.ToList().IndexOf(catspec);

            // Removes the specification from the category
            CategoryModel.CategorySpecifications.Remove(catspec);

            // Every specification coming after the removed one, has its display order reduced by one
            for (int i = removedSpecIndex; i < CategoryModel.CategorySpecifications.Count(); i++)
            {
                CategoryModel.CategorySpecifications.ToList()[i].DisplayOrder = i;
            }

            // Refresh the category specification grid
            BindCategorySpecificationsGrid();
        }
Exemplo n.º 17
0
        public BugTrackingResponse <BusinessObjects.Category> Save(BusinessObjects.Category category)
        {
            Logger.TraceMethodStart(ClassName, "Save");

            var response = new BugTrackingResponse <BusinessObjects.Category>();

            try
            {
                var validator = new CategorySpecification();
                var result    = validator.Validate(category);
                var failures  = result.Errors;

                response.ValidationResult = result;

                if (result.IsValid)
                {
                    category.LastModified = DateTime.Now;
                    category.Active       = true;
                    var newcategory = MapperAllLevels.Map <BusinessObjects.Category, EntityModel.Category>(category);
                    UoW.Categories.Add(newcategory);
                    UoW.Complete();
                }
                else
                {
                    Logger.TraceErrorFormat("Error while Saving {0}", response.ValidationResult.Errors);
                }

                return(response);
            }
            catch (Exception ex)
            {
                Logger.TraceError("Exception: ", ex);
                throw;
            }
            finally
            {
                Logger.TraceMethodEnd(ClassName, "Save");
            }
        }
Exemplo n.º 18
0
        private static void FilterList(IEnumerable <Product> products, string searchBy, string searchKey)
        {
            ISpecification <Product> spec = null;
            var productFilter             = new ProductFilter();

            switch (searchBy.ToLower())
            {
            case "category":
                spec = new CategorySpecification(searchKey);
                break;

            case "color":
                spec = new ColorSpecification(searchKey);
                break;
            }
            Console.WriteLine("\n---------Filtered List------------\n");

            foreach (var item in productFilter.Filter(products, spec))
            {
                Console.WriteLine($"Product: {item.Name}. Category: {item.Category}. Color: {item.Color}");
            }

            Console.WriteLine("\n---------End of List--------------");
        }
Exemplo n.º 19
0
        /// <summary>
        /// Categories pagination
        /// </summary>
        /// <param name="page">current page</param>
        /// <param name="searchQuery">search query</param>
        /// <param name="pageSize">pageSize parametar is fixed(user cant change it)
        /// in this case so we dont need to check if pagesize is negative</param>
        /// <returns>Instnace of IPaginationModel</returns>
        public virtual async Task <IPaginationModel <Category> > GetCategoriesAsync(int?page, string searchQuery, int pageSize)
        {
            //Validate input
            int    currentPage = page ?? 1;
            string search      = searchQuery ?? string.Empty;

            //Get number of instances from database that containts specific text
            var firstSpecification = new CategorySpecification(search);
            var numberOfCategories = await repository.CountAsync(firstSpecification);

            //Is requested page valid ?
            currentPage = maker.CheckPageLimits(currentPage, numberOfCategories, pageSize);

            //Get required instances from database
            int skip = maker.Skip(currentPage, pageSize);
            int take = pageSize;
            var secondSpecification = new CategorySpecification(skip, take, search);
            var listOfCategories    = await repository.ListAsync(secondSpecification);

            //Return instance of IPaginationModel
            var pgOptions = new PaginationOptions(currentPage, numberOfCategories, pageSize);

            return(maker.PreparePaginationModel(listOfCategories, pgOptions));
        }
        public static void Initialize(IRepository <User> userRepository, IRepository <Category> categoryRepository,
                                      IRepository <QuizQuestion> quizQuestionRepository, IRepository <QuizAnswer> quizAnswerRepository)
        {
            var automotives = new Category
            {
                Name      = "Automotives",
                Questions = new List <QuizQuestion>
                {
                    new QuizQuestion("Who invented Ferrari?",
                                     "Enzo Ferrari", "Marco Ferrari", "Ferrrari Murcielago", "Ferruccio Ferrari"),
                    new QuizQuestion("What is both a French wine region and a luxury American automobile?",
                                     "Cadillac", "Chevrolet", "Mercury", "Burgundy"),
                    new QuizQuestion("Which Japanese car brand existed from 1932 until 1983?",
                                     "Datsun", "Nissan", "Toyota", "Honda"),
                    new QuizQuestion("Which Italian family is in charge of FIAT?",
                                     "Agnelli", "Rossi", "Esposito", "Romano")
                }
            };

            var travel = new Category
            {
                Name      = "Travel",
                Questions = new List <QuizQuestion>
                {
                    new QuizQuestion("Which is a German airline?",
                                     "Lufthansa", "Air Germany", "JetBlue", "easyJet")
                }
            };

            var geography = new Category
            {
                Name      = "Geography",
                Questions = new List <QuizQuestion>
                {
                    new QuizQuestion("How many stars does the American flag have?",
                                     "50", "One", "48", "13"),
                    new QuizQuestion("In which European city can you find the home of Anne Frank?",
                                     "Amsterdam", "Rotterdam", "Stockholm", "Copenhagen"),
                    new QuizQuestion("How long is the Great Wall of China?",
                                     "21,000 km (13,000 miles)", "25,0000 km (15,000 miles)", "30,000 km (19,000 miles)",
                                     "40,000 km (25,0000 miles)"),
                    new QuizQuestion("Which animal is on the Flemish flag?",
                                     "Lion", "Bear", "Eagle", "Unicorn"),
                    new QuizQuestion("How many stars are featured on the flag of New Zealand?",
                                     "Four", "13", "Ten", "Five"),
                    new QuizQuestion("What is the capital of Australia?",
                                     "Canberra", "Sydney", "Melbourne", "Brisbane")
                }
            };

            var history = new Category
            {
                Name      = "History",
                Questions = new List <QuizQuestion>
                {
                    new QuizQuestion("In which English town did Adolf Hitler study art?",
                                     "Liverpool", "London", "Birmingham", "York"),
                    new QuizQuestion("Which Italian artist painted the Birth of Venus?",
                                     "Botticelli", "Michelangelo", "Raphael", "Caravaggio"),
                    new QuizQuestion("Who was the original author of Dracula?",
                                     "Bram Stoker", "Oscar Wilde", "Florence Balcombe", "Mary Shelley"),
                    new QuizQuestion("In which Spanish city die the Joan Miro museum open in 1975?",
                                     "Barcelona", "Madrid", "Valencia", "Granada"),
                    new QuizQuestion("Which two months are named after Roman emperors?",
                                     "July and August", "June and July", "August and September", "June and August"),
                    new QuizQuestion("In what year did Princess Diana die?",
                                     "1997", "1995", "1989", "2001"),
                    new QuizQuestion("Which famous British murderer of the 19th century was never arrested?",
                                     "Jack the Ripper", "Amelia Dyer", "Peter Sutcliffe", "Mary Ann Cotton")
                }
            };

            var popCulture = new Category
            {
                Name      = "Pop Culture",
                Questions = new List <QuizQuestion>
                {
                    new QuizQuestion(
                        "Which actor is known for his roles in \"The Hurt Locker\", \"The Bourne Legacy\", and \"American Hustle\"?",
                        "Jeremy Renner", "Anthony Mackie", "Matt Damon", "Robert Downey Jr"),
                    new QuizQuestion(
                        "Which actor appeared in famous films, such as \"Gone in 60 Seconds\", \"Face/Off\", \"Ghost Rider\"",
                        "Nicholas Cage", "Giovanni Ribisi", "John Travolta", "Sam Elliott"),
                    new QuizQuestion("Which actor played James Bond in 1990?",
                                     "Pierce Brosnan", "Sean Connery", "Roger Moore", "Timothy Dalton"),
                    new QuizQuestion(
                        "Which actor played the role of a famous fictional serial killer Hannibal Lecter?",
                        "Anthony Hopkins", "Gary Oldman", "Rhys Ifans", "Richard Brake"),
                    new QuizQuestion("Who is the most famous Hemsworth brother?",
                                     "Chris Hemsworth", "Arnold Hemsworth", "Liam Hemsworth", "Luke Hemsworth"),
                    new QuizQuestion("Which actor was awarded Oscars for the films \"Glory\" and \"Training Day\"?",
                                     "Denzel Washington", "Andre Braugher", "Matthew Broderick", "Ethan Hawke"),
                    new QuizQuestion("Which coffee chain did Madonna work at?",
                                     "Dunkin Donuts", "Starbucks", "Tim Hortons", "McCafé"),
                    new QuizQuestion("Which actor traveled with the circus at the age of 15 and was a tamer?",
                                     "Chuck Norris", "Scott Adkins", "Steven Seagal", "Donnie Yen")
                }
            };

            var biology = new Category
            {
                Name      = "Biology",
                Questions = new List <QuizQuestion>
                {
                    new QuizQuestion("What animal has three hearts?",
                                     "Octopus", "Squid", "Cockroach", "Hagfish"),
                    new QuizQuestion("What is the smallest bird?",
                                     "Colibri", "Hummingbird", "Finch", "Goldcrest"),
                    new QuizQuestion("What is the fastest land animal?",
                                     "Cheetah", "Greyhound", "Lion", "Springbok"),
                    new QuizQuestion("What is the thinnest natural thread?",
                                     "Spider web", "Human hair", "Dog hair", "Horse hair"),
                    new QuizQuestion("Which birds have scales on their wings?",
                                     "Penguins", "Ducks", "Swans", "Puffins"),
                    new QuizQuestion("Which animal has green-colored fat?",
                                     "Crocodile", "Alligator", "Fox", "Dolphin"),
                    new QuizQuestion("What is the largest spider in the world?",
                                     "Goliath Birdeater", "Giant Huntsman", "Grammostola Anthracina", "Colombian Giant Tarantula"),
                    new QuizQuestion("What is an evergreen tree or bush that grows in Australia?",
                                     "Eucalyptus", "Bambus", "Peppermint", "Basil")
                }
            };

            var culture = new Category
            {
                Name      = "Culture",
                Questions = new List <QuizQuestion>
                {
                    new QuizQuestion("What color are the domes of churches in Russia commonly?",
                                     "Gold", "Red", "Silver", "Blue"),
                    new QuizQuestion("In which city is the famous Manneken Pis fountain?",
                                     "Brussels", "Amsterdam", "Bruges", "Antwerp"),
                    new QuizQuestion("Which artist painted The Scream?",
                                     "Edvard Munch", "Pablo Picasso", "Hans Gude", "Anders Zorn"),
                    new QuizQuestion("Which artist painted the Mona Lisa?",
                                     "Leonardo Da Vinci", "Pablo Picasso", "Vincent van Gogh", "Claude Monet"),
                    new QuizQuestion("Which famous French Engineer designed two bridges for the city of Porto?",
                                     "Gustave Eiffel", "Jules Dupuit", "Georges Claude", "Clément Ader"),
                    new QuizQuestion("In which city can you see Michelangelo's David?",
                                     "Florence", "Rome", "Paris", "Berlin"),
                    new QuizQuestion("Who painted the ceiling of the Sistine Chapel?",
                                     "Michelangelo", "Donatello", "Gian Lorenzo Bernini", "Amedeo Modigliani"),
                    new QuizQuestion("In which country was the famous painter El Greco born?",
                                     "Greece", "Spain", "Turkey", "Italy"),
                    new QuizQuestion("In which city was the composer Frédéric Chopin buried?",
                                     "Paris", "Marseille", "Lyon", "Nantes"),
                    new QuizQuestion("Which artist painted the famous painting Guernica?",
                                     "Pablo Picasso", "Vincent van Gogh", "Leonardo Da Vinci", "Edvard Munch")
                }
            };

            var englishLiterature = new Category
            {
                Name      = "English Literature",
                Questions = new List <QuizQuestion>
                {
                    new QuizQuestion("In which city did Romeo and Juliet live?",
                                     "Verona", "Mantua", "Venice", "Florence")
                }
            };

            var bigBangTheory = new Category
            {
                Name      = "Big Bang Theory",
                Questions = new List <QuizQuestion>
                {
                    new QuizQuestion("What did Sheldon and Amy win their Nobel Prize for?",
                                     "Super-Asymmetry", "Dark Matter", "Proton Decay", "Neutrino"),
                    new QuizQuestion("What's the name of Howard and Bernadette's first child?",
                                     "Halley", "Michael", "John", "Sarah"),
                    new QuizQuestion("What school did Leonard go to?",
                                     "Princeton", "MIT", "Stanford", "Cambridge"),
                    new QuizQuestion("What school did Rajesh go to?",
                                     "Cambridge", "MIT", "Stanford", "Princeton"),
                    new QuizQuestion("What school did Howard go to?",
                                     "MIT", "Cambridge", "Stanford", "Princeton"),
                    new QuizQuestion("At what age did Sheldon receive his PhD?",
                                     "16", "14", "17", "19"),
                    new QuizQuestion("In what state did Penny grow up?",
                                     "Nebraska", "South Dakota", "Illinois", "Iowa"),
                    new QuizQuestion("What is Sheldon's IQ?",
                                     "187", "189", "172", "198")
                }
            };

            var technology = new Category
            {
                Name      = "Technology",
                Questions = new List <QuizQuestion>
                {
                    new QuizQuestion("What was the network of computers called from which the internet emerged?",
                                     "Arpanet", "Darpanet", "Netlink", "Swissnet"),
                    new QuizQuestion("In what year was Google launched on the web?",
                                     "1998", "1997", "1995", "1999"),
                    new QuizQuestion("Which unit is an indication for the sound quality of MP3?",
                                     "Kbps", "Gb", "Db", "RAM"),
                    new QuizQuestion("What does RAM stand for?",
                                     "Random Access Memory", "Random Antenna Modem", "Routing Access Machine",
                                     "Rolling Abbreviation Mechanic")
                }
            };

            var categories = new List <Category>
            {
                automotives, travel, geography, history, popCulture, biology, culture, englishLiterature,
                bigBangTheory, technology
            };

            foreach (var category in categories)
            {
                if (category.Questions.Count == 0)
                {
                    continue;
                }

                var categorySpecification = new CategorySpecification(categoryName: category.Name);
                var cat        = categoryRepository.Query(categorySpecification).FirstOrDefault();
                var categoryId = cat?.CategoryId ?? categoryRepository.Create(category);

                foreach (var question in category.Questions)
                {
                    question.CategoryId = categoryId;

                    var correctAnswers = question.Answers.Where(a => a.Correct);
                    if (correctAnswers.Count() != 1 || question.Answers.Count != 4)
                    {
                        Console.WriteLine($"Question with invalid parameters found: {question.Question}");
                        continue;
                    }

                    var questionSpecification = new QuizQuestionSpecification(question: question.Question);
                    var q = quizQuestionRepository.Query(questionSpecification).FirstOrDefault();

                    if (q == null)
                    {
                        var questionId = quizQuestionRepository.Create(question);

                        foreach (var answer in question.Answers)
                        {
                            answer.QuestionId = questionId;
                            quizAnswerRepository.Create(answer);
                        }
                    }
                }
            }

            if (!userRepository.List.Any())
            {
                var hasher = new PasswordHasher();

                hasher.GenerateSalt().HashPassword(hasher.Salt, "admin123");
                var admin = new User("TestAdmin", hasher.Salt, hasher.Hashed, true);

                hasher.GenerateSalt().HashPassword(hasher.Salt, "user123");
                var user = new User("TestUser", hasher.Salt, hasher.Hashed);

                userRepository.Create(admin);
                userRepository.Create(user);
            }
        }