<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Zeeshan Hirani : ASP.NET</title><link>http://weblogs.asp.net/zeeshanhirani/archive/tags/ASP.NET/default.aspx</link><description>Tags: ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Contributions to Entity framework community</title><link>http://weblogs.asp.net/zeeshanhirani/archive/2008/12/18/my-christmas-present-to-the-entity-framework-community.aspx</link><pubDate>Thu, 18 Dec 2008 18:39:37 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6767439</guid><dc:creator>zhirani</dc:creator><slash:comments>23</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/zeeshanhirani/rsscomments.aspx?PostID=6767439</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/zeeshanhirani/commentapi.aspx?PostID=6767439</wfw:comment><comments>http://weblogs.asp.net/zeeshanhirani/archive/2008/12/18/my-christmas-present-to-the-entity-framework-community.aspx#comments</comments><description>&lt;p&gt;If you had been reading my blog, you must be wondering where did he go after publishing such awesome blog entries(jk). I had gotten lot of good feed back on the examples I had done on linq to SQL but like all good things must come to an end so did linq to SQL for me. My company was committed in moving forward with EF so I decided to move forward with Entity framework as well. During the process I learned so much stuff and felt the pain most developers went through with this technology. No doubt EF has a learning curve like any other technology but mapping scenarios offered by EF are simply great. &lt;/p&gt;  &lt;p&gt;May be the reader base can get the same perception about EF and the mapping scenarios it offers even in version 1 as I did, after reading the PDF that contains 500 pages of content about entity framework. I wish I could complete the whole thing and discuss every aspect of EF that I had learned. Time is definitely a concern for me because I have to move to other cool things that I have been wanting to get to but never made it. &lt;/p&gt;  &lt;p&gt;Below is a link to the PDF document that contains examples of various mapping scenarios and concepts that I have learned about entity framework&lt;/p&gt;  &lt;p&gt;&lt;a href="http://cid-245ed00edb4c374e.skydrive.live.com/self.aspx/Public/entity%20framework%20learning%20guide.pdf" target="_blank" mce_href="http://cid-245ed00edb4c374e.skydrive.live.com/self.aspx/Public/entity%20framework%20learning%20guide.pdf"&gt;Entity Framework learning guide&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I have updated the project to include the console app that executes the models. In addition, the zip also contains all the databases required for the projects to run.&lt;/p&gt; &lt;a href="http://cid-245ed00edb4c374e.skydrive.live.com/self.aspx/Public/completeproject.zip" target="_blank"&gt;Complete Project With databases&lt;/a&gt;  &lt;p&gt;Due to time constraints, I have not been able to do editing or modify the English to improve its readability.&amp;#160; My intent was to use this document as learning guide for me and my co-workers but I felt that content is useful enough to benefit rest of the community.&lt;/p&gt;  &lt;p&gt;I hope everyone enjoys the content. If you have any feedback, please be sure to send me an email at &lt;a href="mailto:zeeshanjhirani@gmail.com" mce_href="mailto:zeeshanjhirani@gmail.com"&gt;zeeshanjhirani@gmail.com&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6767439" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/zeeshanhirani/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/zeeshanhirani/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/zeeshanhirani/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/zeeshanhirani/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://weblogs.asp.net/zeeshanhirani/archive/tags/EF/default.aspx">EF</category></item><item><title>Exploring Asp.net Ajax Client Side Library</title><link>http://weblogs.asp.net/zeeshanhirani/archive/2008/03/09/exploring-asp-net-ajax-client-side-library.aspx</link><pubDate>Mon, 10 Mar 2008 01:41:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5941750</guid><dc:creator>zhirani</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/zeeshanhirani/rsscomments.aspx?PostID=5941750</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/zeeshanhirani/commentapi.aspx?PostID=5941750</wfw:comment><comments>http://weblogs.asp.net/zeeshanhirani/archive/2008/03/09/exploring-asp-net-ajax-client-side-library.aspx#comments</comments><description>&lt;P&gt;&lt;FONT size=2&gt;Although javascript is truly not an object oriented languange, microsoft with the release of client side framework for ajax, had really made working with javascript much easier. Today i will explore the concepts for javascript intellisense, notifying asp.ne ajax framework of any external client side libraries and how to create classes and use inheritance to extend those classes.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;To start off i will create a simple class called person in the javascript file called Person.js. Person class will contain a property called Name and a methods called Print.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/image_2.png" mce_href="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/image_2.png"&gt;&lt;FONT color=#000000 size=2&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=463 alt=image src="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/image_thumb.png" width=372 border=0 mce_src="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/image_thumb.png"&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;At the top of the file you will notice a comment which includes MicrosoftAjax.js. This directive is used by visual studio 2008 to provide you intellisense for the microsoft ajax library. Intellisense can simply be provided by adding the comment directive at top of your JavaScript file. Notice that we using the name attribute to reference a JavaScript file that is embedded in an assembly called System.Web.Extensions.dll.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;We create a person class by first initializing the name private variable in the constructor which is typically a function. The naming convention is irrelevant in terms of javascript because javascript has no notion of private variable. However by attributing private variables with underscore, intellisence recognizes it as private variable and ensures that its not visible outside the scope of the class.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Next down we go ahead and create getter and setter for the name property and create a method called Print which simply prints the name variable using alert box.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;After creating the class we go ahead and register the class with the asp.net ajax client side libraray by passing the name of the class in the registerClass method. registerClass happens to be a method defined on the Type object.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;We then finally notify the ajax client side framework that we have finished loading this javascript file. It is recommended practice to call notifyScriptLoaded on every javascript file to notify asp.net ajax.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;We will move forward by creating another class by extending Person class with class Student. Student will have one extra property called SSN and will override the Print method. Lets drill through the Student javascript class.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/image_8.png" mce_href="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/image_8.png"&gt;&lt;FONT color=#000000 size=2&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: 582px; HEIGHT: 470px; BORDER-RIGHT-WIDTH: 0px" height=470 alt=image src="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/image_thumb_3.png" width=702 border=0 mce_src="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/image_thumb_3.png"&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;We wont be covering all the details about the class except for few noticeable items worth mentioning. First notice the comment directive for intellisence uses path variable instead of name and that is because the javascript file we are trying to reference is not embedded in the assembly and belongs to our project. We are also making use of a concept introduced by asp.net ajax client side library called namespace registration. Concept of namespaces only exists in C# and vb.net or other programming langauges. Namespaces helps in preventing naming conflicts by keeping related classes together. The concept was great enough for Microsoft to introduce the registernamespace method in the client side library. It allows you add a particular class to the namespace registered above.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;After registering we go ahead and add a property called ssn and override the print method defined in the person class. In order to access a property defined in the base class, we make use of callBasemethod passing in the name of the method whose value we like to get and then concatenating the results with ssn variable declared inside the Student class. We then go ahead and regsiter the class with ajax client side library but this time we use the second overload which lets u specify the class you are inheriting from which happens to be People.Person class.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Now that we have those two classes ready we can go ahead and create instances of Student class and call Print method to display the result. Here is how the code looks like.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/image_10.png" mce_href="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/image_10.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: 552px; HEIGHT: 421px; BORDER-RIGHT-WIDTH: 0px" height=421 alt=image src="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/image_thumb_4.png" width=646 border=0 mce_src="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/image_thumb_4.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;There is not much to talk about in this code except that we are registering the two JavaScript files with scriptmanager and then inside the pageload function we create an an instance of Student class. We then assign the values to Name and ssn and call print to get an alert dialog on the screen that looks like the screen shot below&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/Windows%20Internet%20Explorer_2.png" mce_href="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/Windows%20Internet%20Explorer_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=138 alt="Windows Internet Explorer" src="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/Windows%20Internet%20Explorer_thumb.png" width=244 border=0 mce_src="http://weblogs.asp.net/blogs/zeeshanhirani/WindowsLiveWriter/ExploringClientSideAjaxLibrary_CD0C/Windows%20Internet%20Explorer_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In this blog posting, i walked you through how to create simple class in javascript that extends other class. We also discussed how namespaces can be used to resolve naming conflicts. I hope this walk through was informative.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5941750" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/zeeshanhirani/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item></channel></rss>