public async Task AddRentModel(AppRepository appRepository, RentModel rentModel)
        {
            var neededRentModel = await appRepository.RentModels.FirstOrDefaultAsync(x => x.Id == rentModel.Id);

            if (neededRentModel == null)
            {
                return;
            }
            if (HolderRentModels == null)
            {
                HolderRentModels = new List <HolderRentModel>();
            }
            if (HolderRentModels.Any(x => x.RentModel.Id == rentModel.Id))
            {
                return;
            }

            var rentModelsList = this.HolderRentModels.ToList();

            rentModelsList.Add(new HolderRentModel()
            {
                RentModel = neededRentModel, HolderModel = this
            });
            this.HolderRentModels = rentModelsList;
            appRepository.Entry(this).Collection(x => x.HolderRentModels).IsModified = true;
            await appRepository.SaveChangesAsync();
        }
        public async Task RemoveRentModel(AppRepository appRepository, RentModel rentModel)
        {
            HolderModel     entity          = this;
            HolderRentModel holderRentModel = entity.HolderRentModels.ToList().FirstOrDefault(x => x.RentModel.Id == rentModel.Id);

            if (holderRentModel == null || entity.HolderRentModels == null || !entity.HolderRentModels.Any(x => x.RentModel.Id == rentModel.Id))
            {
                return;
            }
            List <HolderRentModel> list = entity.HolderRentModels.ToList();

            list.Remove(holderRentModel);
            entity.HolderRentModels = list;
            appRepository.Entry(entity).Collection(x => x.HolderRentModels).IsModified = true;
            int num = await appRepository.SaveChangesAsync();
        }