public IEnumerable <FoundOrLostViewModel> GetAllObjects() { if (ModelState.IsValid) { ILostOrFoundBusiness queryLostOrFoundObjects = DependencyResolution.Instance.GetInstance <ILostOrFoundBusiness>(); return(queryLostOrFoundObjects.GetAllLostOrFoundObjects()); } else { throw new ApiValidationException(ModelState); } }
public async Task <ActionResult> UpdateObject([FromBody] UpdateLostOrFoundViewModel model) { if (ModelState.IsValid) { ILostOrFoundBusiness lostOrFoundObjectsBusiness = DependencyResolution.Instance.GetInstance <ILostOrFoundBusiness>(); lostOrFoundObjectsBusiness.UpdateLostOrFoundObject(model); return(Ok()); } else { throw new ApiValidationException(ModelState); } }