public bool Update(int?Id, SubDistrictParam subdistrictParam)
        {
            var         result         = 0;
            SubDistrict getSubDistrict = Get(Id);

            getSubDistrict.Name       = subdistrictParam.Name;
            getSubDistrict.Regencies  = myContext.Regencies.Find(subdistrictParam.Regencies_Id);
            getSubDistrict.UpdateDate = DateTimeOffset.Now.LocalDateTime;
            result = myContext.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
        public bool Insert(SubDistrictParam subdistrictParam)
        {
            var result = 0;

            subdistrict.Name       = subdistrictParam.Name;
            subdistrict.Regencies  = myContext.Regencies.Find(subdistrictParam.Regencies_Id);
            subdistrict.CreateDate = DateTimeOffset.Now.LocalDateTime;
            subdistrict.IsDelete   = false;
            myContext.SubDistricts.Add(subdistrict);
            result = myContext.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
 public bool Update(int?Id, SubDistrictParam subdistrictParam)
 {
     _subdistrictRepository.Update(Id, subdistrictParam);
     return(status = true);
 }
 public bool Insert(SubDistrictParam subdistrictParam)
 {
     _subdistrictRepository.Insert(subdistrictParam);
     return(status = true);
 }
 // PUT: api/SubDistricts/5
 public void Put(int id, SubDistrictParam subdistrictParam)
 {
     _subdistrictService.Update(id, subdistrictParam);
 }
 // POST: api/SubDistricts
 public void Post(SubDistrictParam subdistrictParam)
 {
     _subdistrictService.Insert(subdistrictParam);
 }