public async Task <IHttpActionResult> GetDiseaseById(int diseaseId) { UnitOfWork uow = new UnitOfWork(new ApplicationDbContext()); GenDiseaseService service = new GenDiseaseService(uow); GenDiseases disease = service.GetGenDiseasesById(diseaseId); return(await Task.FromResult(Ok(disease))); }
public void CheangeDisease(GenDiseases newDisease) { var currentDisease = Uow.GenDiseasesRepository.GetById(newDisease.Id); currentDisease.About = newDisease.About; currentDisease.MenInherited = newDisease.MenInherited; currentDisease.WomenInherited = newDisease.WomenInherited; currentDisease.Name = newDisease.Name; }
public async Task <IHttpActionResult> ChangeDisease(GenDiseases model) { UnitOfWork uow = new UnitOfWork(new ApplicationDbContext()); GenDiseaseService service = new GenDiseaseService(uow); service.CheangeDisease(model); uow.Commit(); return(Ok()); }
public async Task <IHttpActionResult> AddGenDisease(AddGenDiseasesBindingModel model) { UnitOfWork uow = new UnitOfWork(new ApplicationDbContext()); GenDiseaseService service = new GenDiseaseService(uow); var diseases = new GenDiseases() { Name = model.Name, About = model.About, MenInherited = model.MenInherited, WomenInherited = model.WomenInherited }; service.AddNewDisease(diseases); uow.Commit(); return(Ok()); }
public void AddNewDisease(GenDiseases disease) { Uow.GenDiseasesRepository.Add(disease); }