public async Task DeletePhysicianAsync(string id) { using var context = new MedeccContext(); context.Remove(await GetPhysicianAsync(id)); await context.SaveChangesAsync(); }
public Task <Physician> GetPhysicianAsync(string id) { using var context = new MedeccContext(); return(Task.FromResult((from c in context.Caregivers where c.Id == id select c).FirstOrDefault())); }
public Task <ApplicationLogin> FindByIdAsync(string id) { using var context = new MedeccContext(); return(Task.FromResult((from a in context.ApplicationLogins where a.Id == id select a).FirstOrDefault())); }
public Task <ApplicationLogin> FindByNormalizedUserNameAsync(string normalizedUserName) { using var context = new MedeccContext(); return(Task.FromResult((from a in context.ApplicationLogins where a.NormalizedUserName == normalizedUserName select a).FirstOrDefault())); }
public Task <Media> GetMedia(string id) { using var context = new MedeccContext(); return(Task.FromResult((from m in context.Media where m.Id == id select m).FirstOrDefault())); }
public async Task <Physician> UpdatePhysicianAsync(Physician physician) { using var context = new MedeccContext(); context.Update(physician); await context.SaveChangesAsync(); return(physician); }
public async Task <ApplicationLogin> UpdateApplicationLoginAsync(ApplicationLogin applicationLogin) { using var context = new MedeccContext(); var @return = context.Update(applicationLogin); await context.SaveChangesAsync(); return(@return.Entity); }
public Task <IEnumerable <Physician> > GetPhysicianTeam(string id) { using var context = new MedeccContext(); var caregiverTeam = from c in context.Caregivers where c.SupervisorId == id select c; return(Task.FromResult((IEnumerable <Physician>)caregiverTeam.ToArray())); }
public Task <IEnumerable <Message> > GetMessagesByGroup(string groupId) { using var context = new MedeccContext(); var messages = from m in context.Messages where m.GroupId == groupId select m; return(Task.FromResult((IEnumerable <Message>)messages.Include(m => m.Stats).ToArray())); }
public async Task AddApplicationLoginAsync(ApplicationLogin applicationLogin) { var id = Guid.NewGuid().ToString("N");; applicationLogin.Id = id; using var context = new MedeccContext(); await context.AddAsync(applicationLogin); await context.SaveChangesAsync(); }
public async Task <Physician> AddPhysicianAsync(Physician physician) { using var context = new MedeccContext(); physician.Id = Guid.NewGuid().ToString("N");; await context.AddAsync(physician); await context.SaveChangesAsync(); return(physician); }
public async Task <string> AddMedia(Media media) { using var context = new MedeccContext(); var id = Guid.NewGuid().ToString("N");; media.Id = id; await context.AddAsync(media); await context.SaveChangesAsync(); return(id); }
public async Task <string> AddMessage(Message message) { message.Id = Guid.NewGuid().ToString("N");; if (message.Stats != null) { message.Stats.Id = Guid.NewGuid().ToString("N");; } using var context = new MedeccContext(); await context.AddAsync(message); await context.SaveChangesAsync(); return(message.Id); }
public Task <IEnumerable <Physician> > GetPhysiciansAsync() { using var context = new MedeccContext(); return(Task.FromResult((IEnumerable <Physician>)context.Caregivers.ToArray())); }
public Task <IEnumerable <ApplicationLogin> > GetApplicationLoginsAsync() { using var context = new MedeccContext(); return(Task.FromResult((IEnumerable <ApplicationLogin>)context.ApplicationLogins.ToArray())); }