{"id":254,"date":"2021-03-09T16:55:53","date_gmt":"2021-03-09T08:55:53","guid":{"rendered":"https:\/\/www.tonghin.com.my\/blog\/?p=254"},"modified":"2021-03-09T16:55:55","modified_gmt":"2021-03-09T08:55:55","slug":"more-about-entity-framework","status":"publish","type":"post","link":"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/","title":{"rendered":"More about Entity Framework"},"content":{"rendered":"\n<p>I started getting more familiar with EF Core, although I don&#8217;t fully understand everything, I am able to grasp the main idea of how EF Core works, because I helped a friend who is doing his internship as well and was asked to use EF Core and had no idea how to use it. So, I was able to guide here and there which shows that I did learn something about EF Core after all. <\/p>\n\n\n\n<p>If you find difficulties in understanding what I&#8217;m about to discuss refer to my previous blog by clicking on this link before proceeding <a href=\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/04\/entity-framework-core-week\/\">https:\/\/www.tonghin.com.my\/blog\/2021\/03\/04\/entity-framework-core-week\/<\/a>.<\/p>\n\n\n\n<p>I finally have a better understanding of how tests work, and how to write a unit test in general. <\/p>\n\n\n\n<p>A unit test compromises of 3 sections. Firstly, the <span class=\"has-inline-color has-accent-color\">arrange <\/span>part which sets the environment for the test components. Next, <span class=\"has-inline-color has-accent-color\">act<\/span> initiates the test or does the testing. Lastly, <span class=\"has-inline-color has-accent-color\">assert<\/span> validates and verifies the result we expect to get by comparing our expected value to the value retrieved from the act section. <\/p>\n\n\n\n<p>Last week, I wrote around 7 tests with the help of my supervisor, who guides me when I don&#8217;t understand or get stuck at one point or another. <\/p>\n\n\n\n<p>Among the widely used assert extensions are <span class=\"has-inline-color has-accent-color\">First( ), Select( ) and Where( ). <\/span>More information can be read from the below link <a href=\"https:\/\/www.tutorialsteacher.com\/linq\/what-is-linq\">https:\/\/www.tutorialsteacher.com\/linq\/what-is-linq<\/a>.<\/p>\n\n\n\n<p>The concept of <span class=\"has-inline-color has-accent-color\">Rollback( ), Commit( ) and Complete( )<\/span> in a transaction is among the things that I have been exposed to as well, whereby rollback undoes changes that have been committed into the database. Commit on the other hand, saves changes into the database, while complete saves the transaction, it does not update the database if commit was not initiated, as well as if complete was not written in the codes, updates that have been made wont be saved even during debugging of codes.<\/p>\n\n\n\n<p>The keyword <span class=\"has-inline-color has-accent-color\">using<\/span> in C# is used to ensure that the method dispose( ) is called after a method has been called, or or an object has been created and many other things. <span class=\"has-inline-color has-accent-color\">Dispose( )<\/span> is used to release unmanaged resources, but it does not free a managed memory. <\/p>\n\n\n\n<p>That&#8217;s all for this week \ud83d\ude42<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I started getting more familiar with EF Core, although I don&#8217;t fully understand everything, I am able to grasp the main idea of how EF Core works, because I helped a friend who is doing his internship as well and was asked to use EF Core and had no idea how to use it. So, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;More about Entity Framework&#8221;<\/span><\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[72,3,60],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>More about Entity Framework | Tong Hin&#039;s Blog about Technology<\/title>\n<meta name=\"description\" content=\"More into EF Core concepts. Unit testing sections. Usage of complete, commit and rollback in transactions. Usage of the keyword using in C#\" \/>\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.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"More about Entity Framework | Tong Hin&#039;s Blog about Technology\" \/>\n<meta property=\"og:description\" content=\"More into EF Core concepts. Unit testing sections. Usage of complete, commit and rollback in transactions. Usage of the keyword using in C#\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/\" \/>\n<meta property=\"og:site_name\" content=\"Tong Hin&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-09T08:55:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-09T08:55:55+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"2 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#organization\",\"name\":\"TONG HIN MACHINERY\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"sameAs\":[\"https:\/\/www.youtube.com\/channel\/UC60EoxJMNbu8mV0LuEGfrBg\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/wp-content\/uploads\/2020\/10\/web_logo_180_180.jpg\",\"width\":180,\"height\":180,\"caption\":\"TONG HIN MACHINERY\"},\"image\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#website\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"name\":\"Tong Hin&#039;s Blog\",\"description\":\"Sharing About Technology\",\"publisher\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.tonghin.com.my\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/#webpage\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/\",\"name\":\"More about Entity Framework | Tong Hin&#039;s Blog about Technology\",\"isPartOf\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#website\"},\"datePublished\":\"2021-03-09T08:55:53+00:00\",\"dateModified\":\"2021-03-09T08:55:55+00:00\",\"description\":\"More into EF Core concepts. Unit testing sections. Usage of complete, commit and rollback in transactions. Usage of the keyword using in C#\",\"breadcrumb\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/\",\"name\":\"More about Entity Framework\"}}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/#webpage\"},\"author\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#\/schema\/person\/11b81d489377d44deb601a79a57599ee\"},\"headline\":\"More about Entity Framework\",\"datePublished\":\"2021-03-09T08:55:53+00:00\",\"dateModified\":\"2021-03-09T08:55:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/#webpage\"},\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#organization\"},\"keywords\":\"EF Core,tdd,transaction\",\"articleSection\":\"Experiential\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.tonghin.com.my\/blog\/2021\/03\/09\/more-about-entity-framework\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#\/schema\/person\/11b81d489377d44deb601a79a57599ee\",\"name\":\"Faizah Chaibou\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5c69df35ce6d69b7d1b66311b4144ea8?s=96&d=mm&r=g\",\"caption\":\"Faizah Chaibou\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts\/254"}],"collection":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/comments?post=254"}],"version-history":[{"count":7,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts\/254\/revisions"}],"predecessor-version":[{"id":269,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts\/254\/revisions\/269"}],"wp:attachment":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/media?parent=254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/categories?post=254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/tags?post=254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}