public bool CreateGroup(NewGroupDTO request) { try { return(_GroupsRepo.CreateGroup(request.ClientId, request.LevelId, request.CycleId, request.ShortName, request.MinDate, request.MaxDate)); } catch (Exception e) { return(false); } }
// POST: api/Groups /// <summary> /// This method creates new group /// </summary> /// <param name="group"></param> /// <returns>Route of created group</returns> /* [ResponseType(typeof(Group))] * public IHttpActionResult PostGroup(Group group) * { * if (!ModelState.IsValid) * { * return BadRequest(ModelState); * } * * * try * { * groupRepository.CreateGroup(group); * } * catch (DbUpdateException) * { * * throw; * } * * return CreatedAtRoute("DefaultApi", new { id = group.id }, group); * }*/ public Group PostGroup(GroupDetails gd) { return(groupRepository.CreateGroup(gd)); }
public async Task CreateGroup(string groupName) { _groups.CreateGroup(groupName); }