Exemplo n.º 1
0
        public ResponseModel SetFavouriteItem(AddFavtItemRequestModel item)
        {
            var response = new ResponseModel
            {
                Success  = false,
                Messages = new List <string>()
            };

            if (item == null || string.IsNullOrEmpty(item.UserId) || string.IsNullOrEmpty(item.ItemId))
            {
                response.Messages.Add("Mandatory data can not be empty");
            }
            else
            {
                try
                {
                    var responseCall = ListService.AddRemove_Favourite_Restaurent(item);
                    response.Data = item;
                    response.Messages.Add(responseCall);
                    response.Success = true;
                }
                catch (Exception excep)
                {
                    response.Messages.Add("Something bad happened.");
                }
            }
            return(response);
        }