public bool deleteGeospatialData(GeospatialData geospatialData) { try { using (var context = new ArchaeologyContext()) { context.Remove(geospatialData); context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } return(true); }
public GeospatialData readGeospatialData(Guid id) { var retList = new List <GeospatialData>(); var retVal = new GeospatialData(); try { using (var context = new ArchaeologyContext()) { retList = context.GeospatialData .Where(geospatialData => geospatialData.Id == id) .ToList(); } } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } if (retList.Count > 0) { retVal = retList[0]; } return(retVal); }