Beispiel #1
0
        public async Task <IActionResult> AddRecord(PassengerRecord record)
        {
            if (string.IsNullOrEmpty(record.Key) || string.IsNullOrEmpty(record.LastName))
            {
                return(BadRequest(new { Result = false, Message = "Key & last name must not empty" }));
            }

            if (record.Key.Length != 6)
            {
                return(BadRequest(new { Result = false, Message = "key length must be 6 letters" }));
            }


            var res = await MdApi.AddRecord(record);

            return(PartialView("_PartialPassengerList", res));
        }