예제 #1
0
        public IHttpActionResult AddMember(MembersDTO membersDTO)//[FromBody]Members NewMember
        {
            Members members = membersDTO.ConvertToMembers();

            DB.Members.Add(members);
            DB.SaveChanges();
            return(Ok(DB.Members));
        }
예제 #2
0
        public IHttpActionResult EditMember(MembersDTO NewMember)
        {
            Members m  = NewMember.ConvertToMembers();
            Members m2 = DB.Members.Where(x => x.Id == m.Id).First();

            m2.FreeTime = m.FreeTime;

            DB.SaveChanges();
            return(Ok(DB.Members));
        }