public async Task <IActionResult> Create([Bind("OffenderId,OffenderName,OffenderSummary")] Offender offender)
        {
            if (ModelState.IsValid)
            {
                _context.Add(offender);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(offender));
        }
        public async Task <IActionResult> Create([Bind("OffenderGeoFenceId,OffenderId,GeoFenceName,Address,GeoFenceTypeId,NorthEastLatitude,NorthEastLongitude,SouthWestLatitude,SouthWestLongitude")] OffenderGeoFence offenderGeoFence)
        {
            if (ModelState.IsValid)
            {
                _context.Add(offenderGeoFence);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index), new { id = offenderGeoFence.OffenderId }));
            }

            var offender = _context.Offenders.FirstOrDefault(x => x.OffenderId == offenderGeoFence.OffenderId);

            if (offender == null)
            {
                return(NotFound());
            }
            ViewData["Offender"]       = offender;
            ViewData["GeoFenceTypeId"] = this._context.GeoFenceTypes.ToList().Select(x => new SelectListItem()
            {
                Text = x.GeoFenceTypeName, Value = x.GeoFenceTypeId.ToString()
            }).ToList();

            return(View(offenderGeoFence));
        }