示例#1
0
        public async Task <HttpResponseMessage> PutHerkomst(ADHerkomst model)
        {
            bool validated = await ValidateAgainstSchemeAsync("ADHerkomst");

            if (model != null && validated)
            {
                db.ADHerkomsts.AddOrUpdate(model);
                db.SaveChanges();
            }

            return(new HttpResponseMessage(HttpStatusCode.OK));
        }
示例#2
0
        public async Task <HttpResponseMessage> PostHerkomst(ADHerkomst model)
        {
            bool validated = await ValidateAgainstSchemeAsync("ADHerkomst");

            if (model != null && validated)
            {
                db.ADHerkomsts.AddOrUpdate(model);
                db.SaveChanges();
                return(new HttpResponseMessage(HttpStatusCode.OK));
            }
            else
            {
                return(Response(HttpStatusCode.BadRequest, "Could not validate request"));
            }
        }