Example #1
0
        //POST
        public async Task <IHttpActionResult> Post(Application Application)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            context.Applications.Add(Application);
            await context.SaveChangesAsync();

            return(Created(Application));
        }
        //POST
        public async Task <IHttpActionResult> Post(Program Program)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            context.Programs.Add(Program);
            await context.SaveChangesAsync();

            return(Created(Program));
        }
        //POST
        public async Task <IHttpActionResult> Post(Citizenship Citizenship)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            context.Citizenships.Add(Citizenship);
            await context.SaveChangesAsync();

            return(Created(Citizenship));
        }
        //POST
        public async Task <IHttpActionResult> Post(Country Country)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            context.Countries.Add(Country);
            await context.SaveChangesAsync();

            return(Created(Country));
        }
        //POST
        public async Task <IHttpActionResult> Post(AcademicYear AcademicYear)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            context.AcademicYears.Add(AcademicYear);
            await context.SaveChangesAsync();

            return(Created(AcademicYear));
        }