public IEnumerable<MeasuringNotification> GetEntitiesByQuery(Func<MeasuringNotification, bool> query) { if (query == null) { throw new ArgumentNullException("query"); } using (var context = new TrashDomainContext(this.ConnectionString)) { return context.MeasuringNotifications.Where(query).ToList(); } }
public IEnumerable<PersonSymptom> GetEntitiesByQuery(Func<PersonSymptom, bool> query) { if (query == null) { throw new ArgumentNullException("query"); } using (var context = new TrashDomainContext(this.ConnectionString)) { return context.PersonSymptoms.Where(query).ToList(); } }
public void DeleteEntity(Guid id) { using (var context = new TrashDomainContext(this.ConnectionString)) { var personSymptom = context.PersonSymptoms.FirstOrDefault(v => v.Id == id); if (personSymptom == null) { return; } context.PersonSymptoms.Remove(personSymptom); context.SaveChanges(); } }
public void DeleteEntity(Guid id) { using (var context = new TrashDomainContext(this.ConnectionString)) { var measuringNotification = context.MeasuringNotifications.FirstOrDefault(v => v.Id == id); if (measuringNotification == null) { return; } context.MeasuringNotifications.Remove(measuringNotification); context.SaveChanges(); } }
public PersonSymptom CreateOrUpdateEntity(PersonSymptom entity) { if (entity == null) { throw new ArgumentNullException("entity"); } using (var context = new TrashDomainContext(this.ConnectionString)) { if (this.GetEntityById(entity.Id) == null) { context.PersonSymptoms.Add(entity); } else { context.Entry(entity).State = EntityState.Modified; } context.SaveChanges(); } return entity; }
public PersonSymptom GetEntityById(Guid id) { using (var context = new TrashDomainContext(this.ConnectionString)) { return context.PersonSymptoms.FirstOrDefault(v => v.Id == id); } }
public IEnumerable<PersonSymptom> GetAll() { var context = new TrashDomainContext(this.ConnectionString); return context.PersonSymptoms; }
public MeasuringNotification GetEntityById(Guid id) { using (var context = new TrashDomainContext(this.ConnectionString)) { return context.MeasuringNotifications.FirstOrDefault(v => v.Id == id); } }
public IEnumerable<MeasuringNotification> GetAll() { var context = new TrashDomainContext(this.ConnectionString); return context.MeasuringNotifications; }
public IEnumerable<PersonMedicament> GetAll() { var context = new TrashDomainContext(this.ConnectionString); return context.PersonMedicaments; }
public IEnumerable<PersonRiskFactor> GetAll() { var context = new TrashDomainContext(this.ConnectionString); return context.PersonRiskFactors; }
public IEnumerable<Message> GetAll() { var context = new TrashDomainContext(this.ConnectionString); return context.Messages; }