public int GetIdOfSubject(Subjects entityToGetId) { ISubjectsRepository repo = new SubjectsRepository(getEntities()); Entities.Subjects entityToGetId2 = Mapper.Map <Subjects, Entities.Subjects>(entityToGetId); return(repo.GetSubjectId(entityToGetId2)); }