{"id":595,"date":"2015-12-14T09:36:50","date_gmt":"2015-12-14T04:06:50","guid":{"rendered":"http:\/\/stepbystepschools.net\/?p=595"},"modified":"2015-12-14T10:19:34","modified_gmt":"2015-12-14T04:49:34","slug":"asp-net-mvc-training-in-mumbaiandheri-12th-and-13th-saturday-and-sunday","status":"publish","type":"post","link":"https:\/\/www.stepbystepschools.net\/?p=595","title":{"rendered":"ASP.NET MVC Training in Mumbai Andheri (12th and 13th Saturday and Sunday)"},"content":{"rendered":"<p>As usual this ASP.NET MVC Mumbai training batch experience was awesome. We had people coming from Kolhapur which just makes us confident that we are doing good work.<\/p>\n<p>But as a trainer we also learn lot of things and grow with every training and project.One of participants asked how to handle errors from ASP.NET MVCWebAPI to Angular gracefully. For example see the below ASP.NET MVC WebAPI code with the \u201cpost\u201d method. In the below post method we are getting a customer object and this customer object is checked for business validations.<\/p>\n<p>Now if the validations are fine we would like to return \u201cCustomer\u201d object and if there are errors we would like to return validation errors. This is where \u201cHttpResponseMessage\u201d class comes to rescue. This class has two sections one is the data and the other is the status code. So if everything is fine we are returning the OK Http code with customer object or else we are returning bad request with errors.<\/p>\n<p>You can also check for other HTTP status code as per your needs.<\/p>\n<pre>public class CustomerWebController : ApiController\r\n{\r\npublic HttpResponseMessage Post(Customer obj) \r\n{\r\n\/\/ Customer object validated here ( code removed for clarity)\r\nif(isValid)\r\n{\r\nreturn Request.CreateResponse(HttpStatusCode.OK, custs);\r\n}\r\nelse\r\n{\r\nreturn Request.CreateResponse(HttpStatusCode.BadRequest, errors);\r\n}\r\n}\r\n<\/pre>\n<p>Now in Angular where you are making \u201cHTTP\u201d callyou need to implement \u201csuccess\u201d and \u201cfailure\u201d functions. The HTTP OK response from webAPI is sent to the Angular \u201csuccess\u201d function and the HTTP bad request is sent to \u201cerror\u201d function.<\/p>\n<pre>$http({method: \"POST\",data: $scope.Customer, url: \"\/Api\/CustomerWeb\"})\r\n.success(function (data) \r\n{\r\n\/\/ Success code goes here\r\n}).error(function (err)\r\n{\r\n\/\/ Error binding goes here\r\n});\r\n<\/pre>\n<p>Thanks friends for visiting us at Step by Step and wish the best for your future. Our Next ASP.NET MVC Mumbai training batch is on 19th and 20th December i.e. coming week. You can see the syllabus from\u00a0<a href=\"http:\/\/stepbystepschools.net\/?page_id=315\" target=\"_blank\">http:\/\/stepbystepschools.net\/?page_id=315<\/a><\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2015\/12\/MVC.png\"><img loading=\"lazy\" class=\"wp-image-596 alignleft\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2015\/12\/MVC-300x169.png\" alt=\"MVC\" width=\"454\" height=\"256\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2015\/12\/MVC-300x169.png 300w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2015\/12\/MVC.png 442w\" sizes=\"(max-width: 454px) 100vw, 454px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As usual this ASP.NET MVC Mumbai training batch experience was awesome. We had people coming from Kolhapur which just makes us confident that we are doing good work. But as a trainer we also learn lot of things and grow &hellip; <a href=\"https:\/\/www.stepbystepschools.net\/?p=595\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[1,3],"tags":[45,44,27,28,46],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ASP.NET MVC Training in Mumbai Andheri (12th and 13th Saturday and Sunday) - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.stepbystepschools.net\/?p=595\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ASP.NET MVC Training in Mumbai Andheri (12th and 13th Saturday and Sunday) - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\" \/>\n<meta property=\"og:description\" content=\"As usual this ASP.NET MVC Mumbai training batch experience was awesome. We had people coming from Kolhapur which just makes us confident that we are doing good work. But as a trainer we also learn lot of things and grow &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.stepbystepschools.net\/?p=595\" \/>\n<meta property=\"og:site_name\" content=\"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-14T04:06:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-12-14T04:49:34+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2015\/12\/MVC-300x169.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sukesh Marla\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#website\",\"url\":\"https:\/\/www.stepbystepschools.net\/\",\"name\":\"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\",\"description\":\"MVC 5\/Core, AngularJS 1.x, 2.0, 4.0, Design Pattern, Architecture, SSIS, SSAS, SSRS, Data Science, Big data, Hadoop classroom training\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.stepbystepschools.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=595#primaryimage\",\"url\":\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2015\/12\/MVC-300x169.png\",\"contentUrl\":\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2015\/12\/MVC-300x169.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=595#webpage\",\"url\":\"https:\/\/www.stepbystepschools.net\/?p=595\",\"name\":\"ASP.NET MVC Training in Mumbai Andheri (12th and 13th Saturday and Sunday) - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\",\"isPartOf\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=595#primaryimage\"},\"datePublished\":\"2015-12-14T04:06:50+00:00\",\"dateModified\":\"2015-12-14T04:49:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/88d563b9535849b699d9b5efa09d559c\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=595#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.stepbystepschools.net\/?p=595\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=595#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.stepbystepschools.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ASP.NET MVC Training in Mumbai Andheri (12th and 13th Saturday and Sunday)\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/88d563b9535849b699d9b5efa09d559c\",\"name\":\"Sukesh Marla\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7f960ad602065c0f897d127d81b3adf8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7f960ad602065c0f897d127d81b3adf8?s=96&d=mm&r=g\",\"caption\":\"Sukesh Marla\"},\"sameAs\":[\"http:\/\/www.JustCompile.com\"],\"url\":\"https:\/\/www.stepbystepschools.net\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ASP.NET MVC Training in Mumbai Andheri (12th and 13th Saturday and Sunday) - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.stepbystepschools.net\/?p=595","og_locale":"en_US","og_type":"article","og_title":"ASP.NET MVC Training in Mumbai Andheri (12th and 13th Saturday and Sunday) - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","og_description":"As usual this ASP.NET MVC Mumbai training batch experience was awesome. We had people coming from Kolhapur which just makes us confident that we are doing good work. But as a trainer we also learn lot of things and grow &hellip; Continue reading &rarr;","og_url":"https:\/\/www.stepbystepschools.net\/?p=595","og_site_name":"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","article_published_time":"2015-12-14T04:06:50+00:00","article_modified_time":"2015-12-14T04:49:34+00:00","og_image":[{"url":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2015\/12\/MVC-300x169.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sukesh Marla","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.stepbystepschools.net\/#website","url":"https:\/\/www.stepbystepschools.net\/","name":"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","description":"MVC 5\/Core, AngularJS 1.x, 2.0, 4.0, Design Pattern, Architecture, SSIS, SSAS, SSRS, Data Science, Big data, Hadoop classroom training","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.stepbystepschools.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stepbystepschools.net\/?p=595#primaryimage","url":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2015\/12\/MVC-300x169.png","contentUrl":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2015\/12\/MVC-300x169.png"},{"@type":"WebPage","@id":"https:\/\/www.stepbystepschools.net\/?p=595#webpage","url":"https:\/\/www.stepbystepschools.net\/?p=595","name":"ASP.NET MVC Training in Mumbai Andheri (12th and 13th Saturday and Sunday) - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","isPartOf":{"@id":"https:\/\/www.stepbystepschools.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.stepbystepschools.net\/?p=595#primaryimage"},"datePublished":"2015-12-14T04:06:50+00:00","dateModified":"2015-12-14T04:49:34+00:00","author":{"@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/88d563b9535849b699d9b5efa09d559c"},"breadcrumb":{"@id":"https:\/\/www.stepbystepschools.net\/?p=595#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.stepbystepschools.net\/?p=595"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.stepbystepschools.net\/?p=595#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.stepbystepschools.net\/"},{"@type":"ListItem","position":2,"name":"ASP.NET MVC Training in Mumbai Andheri (12th and 13th Saturday and Sunday)"}]},{"@type":"Person","@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/88d563b9535849b699d9b5efa09d559c","name":"Sukesh Marla","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7f960ad602065c0f897d127d81b3adf8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7f960ad602065c0f897d127d81b3adf8?s=96&d=mm&r=g","caption":"Sukesh Marla"},"sameAs":["http:\/\/www.JustCompile.com"],"url":"https:\/\/www.stepbystepschools.net\/?author=2"}]}},"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/595"}],"collection":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=595"}],"version-history":[{"count":4,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/595\/revisions"}],"predecessor-version":[{"id":601,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/595\/revisions\/601"}],"wp:attachment":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}