Esempio n. 1
0
        public static MuscleViewModel CreateMuscleViewModel(this Muscle muscle, DBGetter db)
        {
            MuscleViewModel muscleVM = new MuscleViewModel()
            {
                BodyPartId  = muscle.BodyPartId,
                Description = muscle.Description,
                Image       = muscle.Image,
                MuscleId    = muscle.MuscleId,
                Name        = muscle.Name,
                BodyParts   = db.bodyParts
            };

            return(muscleVM);
        }
Esempio n. 2
0
        public static MuscleViewModel CreateMuscleViewModel(this IMuscleRepository muscleRepo, IBodyPartRepository bPartRepo, int?Id)
        {
            Muscle          muscle   = muscleRepo.GetMusceById(Id);
            MuscleViewModel muscleVM = new MuscleViewModel()
            {
                BodyPartId  = muscle.BodyPartId,
                Description = muscle.Description,
                Image       = muscle.Image,
                MuscleId    = muscle.MuscleId,
                Name        = muscle.Name,
                BodyParts   = bPartRepo.BodyParts.ToList()
            };

            return(muscleVM);
        }