public async Task <ActionResult> Create([FromBody] PersonModel person)
        {
            try
            {
                var addedPerson = await _Repository.AddPersonAsync(person.ToPerson());

                return(Ok(addedPerson.ToPersonModel()));
            }
            catch
            {
                return(BadRequest());
            }
        }
        public async Task <IActionResult> Post([FromBody] RegistsrationRequest model)
        {
            if (!ModelState.IsValid)
            {
                ModelState.AddModelError("Summary", "Registration failed");
                return(BadRequest(ModelState));
            }

            var userIdentity = new AppUser()
            {
                UserName = model.Email,
                Email    = model.Email,
            };

            var result = await _userManager.CreateAsync(userIdentity, model.Password);

            if (result.Succeeded)
            {
                var person = new Person()
                {
                    AppUserId = userIdentity.Id,
                    City      = model.City,
                    FirstName = model.FirstName,
                    LastName  = model.LastName,
                    State     = model.State
                };
                await _ChataloRepository.AddPersonAsync(person);

                string refreshToken = Guid.NewGuid().ToString();
                await _userManager.SetAuthenticationTokenAsync(userIdentity, "RefreshTokenProvider", "RefreshToken", refreshToken);

                var identity = _jwtFactory.GenerateClaimsIdentity(userIdentity.Email, userIdentity.Id, refreshToken);
                var jwt      = await Tokens.GenerateJwt(identity, _jwtFactory, userIdentity.Email, _jwtOptions);

                return(new OkObjectResult(jwt));
            }
            else
            {
                return(new BadRequestObjectResult(Errors.AddErrorsToModelState(result, ModelState)));
            }
        }