Пример #1
0
// ! ***********************************
// ! ********** Specialty **************
// ! ***********************************
        public static Inner_Specialty MapSpecialty(Data_Specialty specialty)
        {
            return(new Inner_Specialty
            {
                SpecialtyId = specialty.SpecialtyId,
                Specialty = specialty.Specialty
            });
        }
Пример #2
0
        /// <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();
        }