Beispiel #1
0
 public PlayListCriteriaViewModel()
 {
     ReloadCheckListBoxes();
     _property = new EditPropertyViewModel(AddEditPropertyType.SearchCriteria)
     {
         Parent = this
     };
 }
 public TrackPropertiesViewModel()
 {
     _iD3Tags = new EditID3TagsViewModel()
     {
         Parent = this
     };
     _editTrackPropertyViewModel = new EditPropertyViewModel(AddEditPropertyType.Track)
     {
         ControlType = PropertyControlType.NoneSelected, Parent = this
     };
     _miscellaneous = new MiscellaneousTrackFunctionsViewModel()
     {
         Parent = this
     };
 }
        public IHttpActionResult Put(EditPropertyViewModel editModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }


            var propertyData = _propertyService.GetPropertyById(editModel.Id);

            if (propertyData == null)
            {
                return(NotFound());
            }

            AutoMapper.Mapper.Map(editModel, propertyData);
            _propertyService.UpdateProperty(propertyData);

            return(StatusCode(HttpStatusCode.NoContent));
        }