public IEnumerable <ProfileJam> Post([FromBody] ProfileJam value)
        {
            int  existingItemCount = profileJamRepo.GetAll().Count(x => x.JamID == value.JamID && x.ProfileID == value.ProfileID);
            bool alreadyExists     = existingItemCount > 0;

            if (!alreadyExists)
            {
                profileJamRepo.Create(value);
            }

            return(profileJamRepo.GetAll().Where(x => x.JamID == value.JamID));
        }
Пример #2
0
 public IEnumerable <Profile> Post([FromBody] Profile value)
 {
     profileRepo.Create(value);
     return(profileRepo.GetAll());
 }
Пример #3
0
 public IEnumerable <Jam> Post([FromBody] Jam value)
 {
     jamRepo.Create(value);
     return(jamRepo.GetAll());
 }