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();
            }
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
        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();
            }
        }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
 public PersonSymptom GetEntityById(Guid id)
 {
     using (var context = new TrashDomainContext(this.ConnectionString))
     {
         return context.PersonSymptoms.FirstOrDefault(v => v.Id == id);
     }
 }
Exemplo n.º 7
0
 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;
 }
Exemplo n.º 10
0
 public IEnumerable<PersonMedicament> GetAll()
 {
     var context = new TrashDomainContext(this.ConnectionString);
     return context.PersonMedicaments;
 }
Exemplo n.º 11
0
 public IEnumerable<PersonRiskFactor> GetAll()
 {
     var context = new TrashDomainContext(this.ConnectionString);
     return context.PersonRiskFactors;
 }
Exemplo n.º 12
0
 public IEnumerable<Message> GetAll()
 {
     var context = new TrashDomainContext(this.ConnectionString);
     return context.Messages;
 }