// ! *********************************** // ! ********** Specialty ************** // ! *********************************** public static Inner_Specialty MapSpecialty(Data_Specialty specialty) { return(new Inner_Specialty { SpecialtyId = specialty.SpecialtyId, Specialty = specialty.Specialty }); }
/// <summary> Updates one existing specialty in the database /// <param name="specialty"> Inner_Specialty Object - represents the fields of a Specialty in the database </param> /// <returns> no return </returns> /// </summary> public async Task UpdateSpecialtyAsync(Inner_Specialty specialty) { Data_Specialty currentEntity = await _context.Specialties.FindAsync(specialty.SpecialtyId); Data_Specialty newEntity = Mapper.UnMapSpecialty(specialty); _context.Entry(currentEntity).CurrentValues.SetValues(newEntity); await Save(); }