Example #1
0
        public async Task <GymContext> SaveGym(GymContext userGymContext)
        {
            if (string.IsNullOrEmpty(userGymContext.Id))
            {
                Gym gymUser = new Gym();
                gymUser = userGymContext.ConvertToNewGym();

                var result = await userEntityService.SaveOneAsync(gymUser);

                return(((Gym)result).ConvertToGymContext());
            }
            //var update = UserConverter.ConvertToUser(userGymContext);
            var update = userGymContext.ConvertToGym();
            await userEntityService.Update(update);

            return(userGymContext);
        }