private List <StudyPlace> BindStudyPlaceList(DataTable datatable) { var objStudyPlace = new List <StudyPlace>(); try { if (datatable != null && datatable.Rows.Count > 0) { for (var j = 0; j < datatable.Rows.Count; j++) { var objStudyPlaceProperty = new StudyPlace { StudyPlaceId = Convert.ToInt32(datatable.Rows[j]["AjStudyPlaceId"]), StudyPlaceName = Convert.ToString(datatable.Rows[j]["AjStudyPlaceName"]), }; objStudyPlace.Add(objStudyPlaceProperty); } } } catch (Exception ex) { var err = ex.Message; if (ex.InnerException != null) { err = err + " :: Inner Exception :- " + ex.ToString(); } const string addInfo = "Error while executing BindStudyPlaceList in Bank.cs :: -> "; var objPub = new ClsExceptionPublisher(); objPub.Publish(err, addInfo); } return(objStudyPlace); }
public StudyPlace UpdateStudyPlace(StudyPlace entity) => _db.Transaction(() => { var found = _db.StudyPlaces.SingleOrDefault(x => x.Id == entity.Id); if (found == null) { return(null); } found.Title = entity.Title; found.Description = entity.Description; return(found); });
public StudyPlace UpdateStudyPlace([FromBody] StudyPlace entity) => _repo.UpdateStudyPlace(entity);