//Update PlaceKind
        public IHttpActionResult Update(PlaceKindViewModel PlaceKindViewModel)
        {
            var pk = _PlaceKindService.GetPlaceKind(PlaceKindViewModel.Id);

            pk.Kind        = PlaceKindViewModel.Kind;
            pk.Description = PlaceKindViewModel.Description;
            pk.DateCreate  = DateTime.Now;
            _PlaceKindService.EditPlaceKind(pk);
            return(Ok());
        }
        public IHttpActionResult Create(PlaceKindViewModel placeKind)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            PlaceKind pk = new PlaceKind();

            pk.Kind        = placeKind.Kind;
            pk.Description = placeKind.Description;
            pk.Priority    = placeKind.Priority;
            pk.DateCreate  = DateTime.Now;
            _PlaceKindService.CreatePlaceKind(pk);
            return(Ok());
        }
        //Get all PlaceKind
        public IHttpActionResult Get()
        {
            var PlaceKinds = _PlaceKindService.GetPlaceKinds();
            List <PlaceKindViewModel> pkvms = new List <PlaceKindViewModel>();

            foreach (var pk in PlaceKinds)
            {
                PlaceKindViewModel pkvm = new PlaceKindViewModel();
                pkvm.Id          = pk.Id;
                pkvm.Kind        = pk.Kind;
                pkvm.Description = pk.Description;
                pkvm.DateCreate  = pk.DateCreate;
                pkvms.Add(pkvm);
            }
            return(Ok(pkvms));
        }
 //Destroy PlaceKind by ViewModel
 public IHttpActionResult Destroy(PlaceKindViewModel PlaceKindViewModel)
 {
     _PlaceKindService.RemovePlaceKind(PlaceKindViewModel.Id);
     return(Ok());
 }