Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Intro to .NET for Government Developers


Published on

Presention I gave at the 2012 SC GMIS Developer Summit. Covers a wide range of .NET Developer Topics.

Published in: Technology
  • Login to see the comments

  • Be the first to like this

Intro to .NET for Government Developers

  1. 1. Developing with.NET Frank La Vigne Developer Evangelist Microsoft @tableteer |
  2. 2. Not just downloads• Documentation• Articles• Sample Code• Specialty sites • ASP.NET • •• And much more!A Quick Word About MSDN
  3. 3. The Future
  4. 4. Soon, Very Soon.
  5. 5. • Visual Studio 2010 • Multiple versions with multiple price points• Expression BlendNice to have tools• F12 Dev Tools• Fiddler• Silverlight SpyTools of the Trade
  6. 6. Web Windows Cloud Phone Games Data Write .NET Code in All of These Environments.NET Everywhere
  7. 7. Win AndWPF DLR ASP.NET WCF LINQ Forms more! Base Class Libraries.NET Framework Common Language RuntimeArchitecture JIT & Garbage Security Exception Loader & NGEN Collector Model Handling Binder.NET Architecture
  9. 9.  Set of public types and APIs System.Threading System.Threading.Tasks// Sequentialforeach (var item in sourceCollection){ Process(item);}// ParallelParallel.ForEach(sourceCollection, item =>Process(item)); Task Parallel Library (TPL)
  10. 10.  Implements the full set of LINQ standard query operators Extension methods for the IParallelEnumerable interface Additional operators for parallel operationsfrom n innames.AsParallel().WithDegreeOfParallelism(ProcessorsToUse.Value)where n.Name.Equals(queryInfo.Name, StringComparison.InvariantCultureIgnoreCase) && n.State == queryInfo.State && n.Year >= yearStart && n.Year <= yearEnd orderby n.Year ascending select n; Parallel LINQ (PLINQ)
  11. 11. • System.Diagnostics.Contracts• Code Contracts introduce a way to specify contractual information that is not represented by a method or type’s signature alone• Scenarios for using contracts include: • Perform static bug finding, which enables some bugs to be found without executing the code • Create guidance for automated testing tools to enhance test coverage • Create a standard notation for code behavior, which provides more information for documentation Design By Contract
  12. 12. • BigInteger • Immutable type that represents an arbitrarily large integer whose value in theory has no upper or lower bounds• SortedSet<T> • Provides a self-balancing tree that maintains data in sorted order after insertions, deletions, and searches Data Types
  13. 13. • Memory-Mapped File • Used to edit very large files and to create shared memory for inter-process communication• Stream.CopyTo • Allows you to copy the contents of one stream into anotherI/O
  15. 15. • Auto-Implemented Properties • Shortened syntax that enables you to quickly specify a property of a class without having to write code• Collection Initializer • Shortened syntax that enables you to create a collection and populate it with an initial set of values• Implicit Line Continuation • Enables you to continue a statement on the next consecutive line without using the underscore characterVisual Basic
  16. 16. • Dynamic Type • Operations that contain expressions of type dynamic are not resolved or type ch`ecked by the compiler. The compiler packages together information about the operation, and that information is later used to evaluate the operation at run time• Optional and Named Parameters • Named arguments enable you to specify an argument for a particular parameter by associating the argument with the parameters name rather than with the parameters position in the parameter list. • Optional arguments enable you to omit arguments for some parameters. Both techniques can be used with methods, indexers, constructors, and delegates. C#
  17. 17. • You can configure restart manager to autosave documents and restart your application after it exits unexpectedly• Lambda expressions are available in C++• The new CTaskDialog replaces the standard Windows message box and adds functionality to display and gather more informationC++
  18. 18. • IDE support for F#• Interactive F# for prototyping code• Asynchronous constructs• Parallel constructs• Immutable data typesF#
  19. 19. Web Client Development
  20. 20. But What About?
  21. 21. I <3 Silverlight!
  22. 22. • Blue Angels Web Site • Can Use Them Both
  23. 23. Looking Forward
  24. 24. Pinning
  25. 25. Web Platform Installer Ajax Control Toolkit & jQuery ASP.NET ADO.NET Entity Framework SQL Server IISThe Microsoft Web Platform combines a rich and powerful webapplication framework with a supporting cast oftools, servers, technologies and applications forcreating, designing, developing and delivering web solutions.The Microsoft Web Platform
  26. 26. I’m a professional I <3 Web Apps. I want to build web software developer and I just need a tool that sites myself with an I build complex, large makes them easier to easy to learn tool scale web sites with a configure, customize and framework team of developers and publish themToday’s Web Developers
  27. 27. A Free Web Dev Tool
  28. 28. Visual Studio 2010 WebMatrix ASP.NET Core Caching Modules Globalization Web Forms View Engine Razor View Engine Pages Controls Master Pages Profile Roles Membership ASP.NET ASP.NET ASP.NET Web Forms Intrinsics MVC Handlers Web Pages Etc.ASP.NET: A Framework For All
  29. 29. • Ability to set meta tags• More control over view state• Added and Updated browser definition files• ASP.NET Routing• The ability to persist selected rows in data controls• More control over rendered HTML in the FormView and ListView controls• Filtering support for data source controls ASP.NET 4 Webforms
  30. 30. WHAT IS MVC?
  31. 31. • Huge investment from Microsoft• Alternative to WebForms• Modular Architecture• MVC 3.0 now available • MVC 4 in Developer Preview stage• Razor Syntax• MVC 3.0 Tooling Updated April 2011Model-View-Controller(MVC)
  32. 32. Controller (Input) View Model (Presentation) (Data)ASP.NET MVC 101
  33. 33. • What does MVC look like? Controller Request Controller Retrieves Model “Performs Work” View Response View Visually represents the modelHow MVC Works
  35. 35. • Users disdain “Ugly” URLs • GURATION=1000&PARTITION_ID=1&CMD=VIEW_A RTICLE&ARTICLE_ID=11951&USERTYPE=1&LANGU AGE=en&COUNTRY=US vs remarks• Search Engine Optimization (SEO) • DiscoverabilityMore Web Savvy Citizens
  36. 36. • Powerful, patterns-based way to build dynamic websites• Enables a clean separation of concerns• Gives you full control over markup for enjoyable, agile development.Developer Productivity
  37. 37. • Enable fast, TDD-friendly development for creating sophisticated applications• Separation of concerns makes for easier testingTesting
  38. 38. • Uses the latest web standards.• Full control over markup makes creating compliant sites easierAccessibility
  39. 39. • No ViewState • Smaller HTML payload • Faster downloads• HTML5 • Easy to implement eye catching graphics that leverage GPU acceleration with IE9 and IE10Performance
  40. 40. DEMOCreating an ASP.NET MVC 3 Project
  41. 41. Razor
  42. 42. @if (You.Understand(Razor)) { <div>Hooray!</div>}• New, Simplified View Engine• Write fewer lines of code• More natural mix code and markup• Helpers save you time• Compatible with ASP.NET Web Pages in WebMatrix • Razor Syntax
  43. 43. Web Forms <ul> (6 markup transitions): <% for (int i = 0; i < 10; i++) { %> <li><% =i %></li> <% } %> </ul> PHP <ul> <?php (2 markup transitions for ($i = 0; $i < 10; $i++) { & an echo): echo("<li>$i</li>"); } ?> </ul> Razor <ul> @for (int i = 0; i < 10; i++) { (2 markup transitions): <li>@i</li> } </ul>Razor: a Cut Above the Rest
  44. 44. @{ var name = “John Doe”; Option 1: <div> HTML Block Your name: @name </div> } @{ var name = “John Doe”; Option 2: <text> Text Block Your name: @name </text> } Option 3: @{ var name = “John Doe”; Single line of output @: Your name: @name in markup }Easier Code to Markup Transitions
  45. 45. @* <div> Option 1: Hello World Markup </div> *@ @{ //var name = "John Doe”; Option 2: //@name Code } @* Option 3: @{ var name = "John Doe"; Both @name } *@Code Comments in Razor
  47. 47. Two Platforms
  48. 48. WPF SilverlightSimilar But Different
  49. 49. Two Core One Common Technologies Language2 Platforms Powered By XAML
  50. 50. • Markup language derived from XML• XML serialization of CLR objects• Markup files have code-behind files • Could be C# or VB.NET• Conceptually similar to ASP.NET• X stands for Extensible • Data Binding • Styles • TemplatesIntro to XAML
  51. 51. <Windowxmlns=""xmlns:sys="clr-namespace:System;assembly=mscorlib"xmlns:x="" > <Grid> <Button>Click Me!</Button> </Grid></Window> What Does XAML Look Like?
  52. 52. Results
  53. 53. Most Devs Reaction to Blend
  54. 54. Demo
  55. 55. Mobile
  56. 56. For the purposes of this talk, we’ll focus on Silverlight.1 Platform. 2 Choices.
  57. 57. What is Metro?
  59. 59. Desktop?
  60. 60. •• Resources
  61. 61. DEMOCreating a Windows Phone App
  62. 62. Marketplace Sample
  63. 63. • Creates Entity Model from Database• Helpful in creating RESTful Services• Exposes Database as Classes/Methods• Works with any Database• Useful in MVC, Dynamic Data ModelsWhat is the Entity Framework?
  64. 64. Database Generated First Existing Entity Data Database Model Model First Entity Data Generated Model DatabaseCode-First in EF 4.1
  65. 65. DEMO
  66. 66.  Phone SDK Download Web Matrix Azure Useful Resources