public async Task Create(PracticeEntity model) { var userId = _httpContext.User.Identity.GetUserId(); _context.Practice.Add(model); await _context.SaveChangesAsync(userId); }
public async Task UpdatePractice(PracticeEntity practice) { var practicePut = await PIDBContext.Practices.SingleAsync(c => c.Id == practice.Id); practicePut.Title = practice.Title; practicePut.Question = practice.Question; practicePut.TrueAnswer = practice.TrueAnswer; practicePut.FalseAnswer1 = practice.FalseAnswer1; practicePut.FalseAnswer2 = practice.FalseAnswer2; practicePut.FalseAnswer3 = practice.FalseAnswer3; }
public PracticeModel(PracticeEntity entity) { Practice = entity.PracticeAbbr; Practice_ID = entity.PracticeId; Environment = entity.Environment; Address1 = entity.Address1; Address2 = entity.Address2; City = entity.City; State = entity.State; Zip = entity.Zip; Phone = entity.Phone; PracticePK = entity.PracticePk; }
private static PracticeEntity FetchPractice(string practiceAbbr) { var path = new PrefetchPath2((int)EntityType.PracticeEntity); path.Add(PracticeEntity.PrefetchPathClinics); var practiceEntity = new PracticeEntity(); practiceEntity.PracticeAbbr = practiceAbbr; using (IDataAccessAdapter adapter = AdapterFactory.CreateAdapter(MyNameSpace)) { bool fetchResult = adapter.FetchEntityUsingUniqueConstraint(practiceEntity, practiceEntity.ConstructFilterForUCPracticeAbbr(), path); if (!fetchResult) { // Not found. Place handle code here. return(null); } } return(practiceEntity); }
public void AddPractice(PracticeEntity practice) { PIDBContext.Entry(practice.Section).State = EntityState.Unchanged; PIDBContext.Practices.Add(practice); }
public Task Update(PracticeEntity model) { throw new NotImplementedException(); }