Ejemplo n.º 1
0
        //[ValidateAntiForgeryToken]
        public async Task <ActionResult> Create(FacultyMeta collection)
        {
            try
            {
                var Result = await _iHttpClient.PostAsync <FacultyMeta>("Faculty", collection);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Edit(string id, FacultyMeta name)
        {
            try
            {
                string uri    = "Faculty/Update/";
                string Url    = uri.ToString() + id.ToString() + "/" + name.NameFaculty.ToString();
                var    Result = await _iHttpClient.PutAsync <FacultyMeta>(Url, name);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }