コード例 #1
0
        public JsonResult AddUSer([FromBody] Item item)
        {
            var  str    = _vendor.AddItem(_mapper.Map <WoofyTailsDALLayer.EFModels.Item>(item));
            bool status = false;

            if (str.Contains("item added sucessfully"))
            {
                status = true;
            }
            return(new JsonResult(new { Success = status, message = status ? str.Substring(0, str.Length - 36) : str, itemid = status ? str.Substring(str.Length - 36) : "0" }));

            //else
            //{
            //    return new JsonResult(new { Message = "Enter Valid Data", ReceivedData = ModelState });
            //}
        }