Example #1
0
        public IActionResult Index(string tag)
        {
            var model = _modelExctractionService.ExctractModelFromFile().ToList <UserModel>();

            if (!string.IsNullOrEmpty(tag))
            {
                model = model.Where(m => m.Tags.Contains(tag)).ToList();
            }
            return(View(model));
        }
Example #2
0
        public static void SeedUsers(this UserManager <ApplicationUser> userManager, IModelExtractionService <List <UserDataModel> > extractionService)
        {
            var model = extractionService.ExctractModelFromFile();

            model.ForEach(u => {
                userManager.CreateAsync(new ApplicationUser {
                    Login    = u.Login,
                    UserName = u.Name
                }, u.Password);
            });
        }