Setting up ASP.NET Core for APIs isn't what I would called complex, but it does involve it's own set of boilerplate. To provide flexibility, .NET 6 now supports Minimal APIs, let's dig into how it works.
I get tagged in a lot of discussion about Dapper vs. Entity Framework. This feels like nHibernate v. Linq2Sql redux. Well, I think about it very differently.
.NET 6 Preview 6 is here. One of the big changes I'm looking forward to is how startup is changing. With this change, comes "Minimal APIs" too. While getting rid of the Startup class is a welcome change, I'm a little less excited about how Minimal APIs might be over-used.
Like most of you, I've been using Dependency Injection in my projects for quite a while. Whether it be the built-in .NET Core Dependency Injection layer, Ninject, StructureMap, Unity, MEF, etc. I've been using a DI layer to do this work for many years. But before I understood the benefit, I did so somewhat reluctantly.
Over three years ago I launched a new option for learning at my company's website (https://courses.wilderminds.com). I was really excited to be able to create courses that weren't the mold of my Pluralsight courses. I wanted to be able to experiment with different ways of teaching people how to code.
I hope you're watching the .NET Conf happening this week. If you have, you know that .NET 5 was finally released. This version isn't a long-term support (LTS) version, but that doesn't mean that many people will be using it in production...at least I will be.
If you're using .NET Core 3 and Entity Framework Core 3 together, you're probably using the EF Tools too. I've been running into an odd issue with it and wanted to share what is going on.
I've had a great time this week attending two events and talking about things I love: .NET and Vue.
If you read my blog, you probably already know how excited I am about ASP.NET 5. To dovetail with that, I’ve created a nine-hour course on Pluralsight that covers this brand-new technology from Redmond.
I had planned on finishing these a long time ago, but working on my Pluralsight course about ASP.NET 5 distracted me. Sorry about that.
As many of you know, I’m not in the country at the moment but if I were, I’d be going to .NET Fringe in Portland, Oregon on April 12-14th. This new conference is all about open source in the .NET space and I and really excited that a conference is focused on it.
Over the past few weeks I’ve been playing with the new ASP.NET 5 (also known as ASP.NET vNext) bits using Visual Studio 2015. I’m trying to make sense of the new changes and how they will affect how I build websites. I’d like to share some of what I’ve learned about the new stack.
The last stop of the week was in Nottingham. I had a chat with the Sheriff about some stolen hoodies. At least that’s what I thought he said – his accent was quite thick ; )
As my first talk in the UK, I was tasked with doing two talks in one day. The group was a lot of fun and asked some key questions.
One of the things that I help companies with are code reviews. I love doing code reviews. It let’s me look at a large codebase with fresh eyes and help a company out with a set of recommendations for improving their process, teams and code.
As some of you may have noticed, I’ve been dipping more than my toe in the waters of Node.js. I think Node.js has a lot to teach us as ASP.NET Web Developers; most of it good.
I know that many of my readers are .NET guys and a core constituency actively hate JavaScript so bear with me and let’s talk about NodeJS for a minute.
I am headed to Build Windows next week and I have a lot of hopes for the conference. I haven’t been to a conference as an attendee alone in quite a long time. I am anxious to see what the v.Next is out of Redmond.
Url: http://msdn.microsoft.com/en-us/ff472347.aspx
Url: http://www.codinghorror.com/blog/archives/00036...
Url: http://www.amazon.com/LINQ-Action-Fabrice-Margu...
I've been converting some projects to Visual Studio 2008 (but not .NET 3.5) to see if I like the new IDE better than 2005. So far I can't tell a big difference (though the improved Script debugging is nice). I did find out something interesting...
After digging into the TimeZoneInfo class, John Meyer pointed me a the new DateTimeOffset class and a MSDN article on choosing between DateTime, DateTimeOffset and TimeZoneInfo classes. I think I am more confused by the article than before. Here are a couple of key bits of information:
I've been digging into the .NET 3.5 runtime to find any tidbits that didn't make the front pages of everyone's blogs this last year. You can find the big stories anywhere else, I want to cover the small interesting stories of what's new in the Framework. I'll be covering some classes over the next few days that I've found in the .NET 3.5 Framework (and hopefully I don't find anything I didn't notice in 2.0 or 3.0, but feel free to correct me if I am wrong).
Url: http://weblogs.asp.net/scottgu/archive/2007/11/...
Url: http://download.microsoft.com/download/4/a/3/4a...
Trish and I are moving soon. She's been sending me links to rugs for our new living room floor. She found an interesting one today:
Url: http://www.panopticoncentral.net/archive/2005/0...
Url: http://www.microsoft.com/downloads/details.aspx...
Url: http://wilderminds.blob.core.windows.net/downloads/TestDataConnect...
Url: http://wilderminds.blob.core.windows.net/downloads/adoguy.profile.zip
Url: http://msdn.microsoft.com/library/default.asp?u...
Url: http://blogs.msdn.com/adonet/archive/2006/10/30...
Url: http://www.devsource.com/article2/0,1895,202254...
Url: http://wilderminds.blob.core.windows.net/downloads/datasourcesgone...
Url: http://webproject.scottgu.com/Default.aspx
Url: http://www.dunntraining.com/EnterpriseDataArchi...
Url: http://blogs.msdn.com/katieblanch/archive/2006/...
Url: http://msdn.microsoft.com/vstudio/support/servi...
I have been attempting to try out some new software from Microsoft (including Glidepath and Visual Studio Database Edition). Both of these require SQL Server Express installed. Problem is that I install a Developer Edition of SQL Server 2005 (as well as 2000) because it is more feature friendly than SQL Server Express. Why does Microsoft insist I have a third Database server? Why can't it prompt me to tell it what database to use, or at least attempt to find SQL Server 2005 as the default instance on the current machine? Just stoopid in my opinion. It's keeping me from trying out and possibly exhaulting these new interesting projects.
Url: http://pluralsight.com/blogs/fritz/archive/2006...
Url: http://wildermuth.com/viewrant.aspx?id=2053
I have been a fan of Typed DataSets since the PDC Beta of .NET. I’ve been asked to detail my recent criticism of Table Adapters in the .NET 2.0 Typed DataSets. Here are the points that I am most concerned with:
I was having a chat with David Sceppa about TableAdapters recently when he mentioned that in the final VS 2005 bits, the TableAdapters will use timestamp fields for concurrency. I told him flatly I didn't think it worked, but I was wrong. If you create a Table in a Typed DataSet in VS 2005 and include the timestamp field in the select statement, it will use the timestamp field for concurrency. Awesome!
Url: http://msdn2.microsoft.com/en-US/library/system...
Url: http://blogs.msdn.com/winfs/archive/2006/05/22/...
I've been scratching my head at the ASP.NET 2.0 TreeView control. This control is meant to show a tree of items and each item can have a link to it. For example, this is what I use for my menu on the left of the page.
Url: http://www.amazon.com/gp/product/0735622779/ref...
Url: http://msdn.microsoft.com/windowsvista/default....
Url: http://support.microsoft.com/default.aspx?scid=...
Url: http://msdn.microsoft.com/winfx/default.aspx?pu...
Url: http://www.amazon.com/exec/obidos/ASIN/15905951...
Url: http://www.wintellect.com/BookInformation.aspx?...
Url: http://msdn.microsoft.com/library/default.asp?u...
Url: http://msdn.microsoft.com/library/default.asp?u...
Url: http://lab.msdn.microsoft.com/productfeedback/v...
Url: http://webproject.scottgu.com/
I am currently doing a bunch of evaluations on OR Mappers, Code Gen and Business Object Frameworks for my new book. If anyone knows about anything great that might go unnoticed, please drop a comment or send me an email!
Url: http://msdn.microsoft.com/newsgroups/default.as...
I've been working on a problem for a client's project. We are doing pretty raw RAD design for a small intranet project so I thought, hey let's just do SqlDataSources to get the pages up and running fast. This works fine *if* we don't want any concurrency.
Welcome to the new version of The ADO Guy. Most of the changes are under the covers, but there are a few things to note:
Url: http://discuss.develop.com/archives/wa.exe?A2=i...
Url: http://blogs.msdn.com/scottwoo/archive/2005/10/...
There are several blogs that have discussed how to share an auth cookie between sites in a farm and how to do a true single-signon for a domain. Mark Brooks pointed me to these that help a lot:
Url: http://forums.asp.net/1039804/ShowPost.aspx
Url: http://lab.msdn.microsoft.com/productfeedback/v...
Url: http://lab.msdn.microsoft.com/productfeedback/v...
Url: http://lab.msdn.microsoft.com/productfeedback/v...
It's not finished yet, but I am working on a Font Browser using Avalon. It's fun to work with XAML and code-behind, but without splitter or treeview controls its hard to make something really fun. I am also working on a database browser with Avalon, but until I find a tree view that project is dead.
Back in the day when ASP.NET shipped, I converted this site from the existing ASP based site. As an exercise to really bring in some new features I've wanted and to lose the ASP legacy (I actually still have a page or two that uses string concatenation to put together HTML Tables), I want to do a full re-write of the site.
For the new wildermuth.com, I have the following requirements:
I found it very interesting in a little test that the Flags attribute doesn't seem to change the way that the CLR numbers Enumerations. So that this enumeration:
This new property (*not* event), allows you to wire up clientside code to be executed before the server-side onclick is handled. In the old days we had to do this manually. For example, this is how you would hook up a simple confirmation dialog:
This probably isn't entirely correct since I am just looking at the output (e.g. the database rows) to determine this. For each object in profile (i.e. Users), there is a single row in the aspnet_Profile table. This table is made up like so:
I am working on a portal project with ASP.NET 2.0 and I am loving it. Lots of stuff is in the box that I need. The project is using VB.NET so I wanted to make sure that everything was Option Explcit On and Option Strict On...but since it is a Web Application, the normal property pages are nowhere to be found (unless I am missing it). If I create any other project type (I think), I can look at the project property pages and see the Compile tab:
Url: http://jelle.druyts.net/PermaLink.aspx?guid=616...
Url: http://news.com.com/Oracle+readies+second+grid+...
In previous builds, the DataSet had a property on them that said whether they should clear the DataSet whenever it is Filled by a DataAdapter. It seems to be missing in the latest builds. I actually prefer this because the nature of DataSets (and often overlooked) is that successive DataAdapter.Fill's will allow a DataSet to grow incrementally. New rows will be added, and existing rows will be updated (unless it is dirty, then you would get an exception).
I've been digging deep in to ASP.NET 2.0 the last couple weeks and I have been pleasantly surprised by a number of nice changes that probably didn't make the new features lists:
Url: http://www.theserverside.net/articles/showartic...
Url: http://msdn.microsoft.com/asp.net/whidbey/beta2...
Url: http://www.devsource.com/article2/0,1759,182186...
Url: http://www.microsoft.com/downloads/details.aspx...
Url: http://www.devcow.com/weblogs/To+Use+DataSets+O...
Url: http://channel9.msdn.com/ShowPost.aspx?PostID=5...
Url: http://wildermuth.com/content.aspx?id=rantview&...
Url: http://www.microsoft.com/downloads/details.aspx...
Url: http://www.windojitsu.com/blog/nestedclasses101...
I've spent most of the last week in Redmond seeing some new stuff and meeting up with old friends. While I was here I scheduled some time to sit down with Steve Lasker of the Visual Basic/Visual Studio Team. His team in in charge of the Typed DataSet in Whidbey.
Url: http://www.hanselman.com/blog/PermaLink,guid,b3...
Url: http://wilderminds.blob.core.windows.net/downloads/autoplaylist.zip
Url: http://msdn.microsoft.com/library/default.asp?u...
Url: http://www.oracle.com/technology/tech/dotnet/in...
I always forget this blog this, but when I am doing a database project using Typed DataSets, I almost always use a Component Surface to build my DataAdapters interactively. For example:
Url: http://www.atlantamobility.net/
Url: http://dotnetjunkies.com/WebLog/sahilmalik/arch...
For some time now I've been pushing the idea of doing DataSet updates using DataAdapters that use a 1-to-1 relationship between DataAdapter and logical data elements (e.g. Tables or Stored Procedures usually). This is especially true when you are dealing with related tables in DataSets (the sweet spot for DataSets IMHO). I've continually forgotten to post this code that I use to do these updates. The idea of this code is for the user to provide arrays of Tables and DataAdapters that imply the order of the updates. For example
Url: http://www.devsource.com/article2/0,1759,174964...
Url: http://blogs.msdn.com/ricom/archive/2004/12/10/...
I haven't dealt with a ton of COM interop up to this point in my .NET life. I was surprised to find out that there is not a good story for deterministic deconstruction of COM objects...or maybe there is and I didn't see it.
Url: http://www.theserverside.net/cartoons/Top10_NET...
Url: http://www.dotnetconsult.co.uk/weblog/permalink...
Url: http://wildermuth.com/powertoys
I have been having a conversation about coupling of objects at the interface level. While I am not a fan of coupling objects together, I would like to be able to shortcut some factory code to make the interface be more intuitive. For example, here is code that decouples the interface:
Url: http://news.com.com/Novell+ships+cross-platform...
Url: http://news.com.com/2100-1012_3-5172166.html?ta...
I got to play with an Itanium 2 Box at the PDC today. Instead of following their script, I did what I've wanted to do for months...creating a huge DataSet. They had an interesting setup. You used a Pentium 4 box to develop code and then Terminal Service'd into a sixteen-way Itanium 2 machine to run the code. The 64 bit JIT's the IL to 64 bit code from the same assembly that the 32 bit JIT did to create the 32 bit code.
Other than LAX being 'smoked' in, there is not much to report today. A number of MS employees seem to be stuck at SeaTac waiting for the smoke from the bush fires to clear out. On my way in last night, we flew over the fires. It was pretty impressive. We were in a holding pattern over the fires and could smell the wood smoke in the plane. After a few nervous passengers asked the staff, we were reassured that it was only from the fires below
Well, I am off to LA Saturday morning. In all the years I've been doing this stuff, I've *never* been to a PDC. Now I am feeling overwhelmed with what to dig into while I am there. I am lucky that I've had the opportunity to see Longhorn, Whidbey and Yukon before the PDC, but just haven't had the time to dig into Indigo and Avalon.
The PDC talk is heating up and it is clear to me that there is a huge number of 'wow' features that will be unveiled in LA. It seems like most of the other bloggers are talking about what I think is protected behind the multitude of NDA's I've signed. So to be safe I am keeping my mouth shut...tightly. What I can say is that what you'll see at the show about Whidbey, Yukon and Longhorn are phenomenal. Some of it is evolutionary, but much of it is revolutionary. I think you’ll be pleased... I am.
Url: http://www.ftponline.com/conferences/vslive/200...
Everytime I add a app.config file to a new C# App, it never does what I want. I want the app.config file to be deployed to the build directory so I can make changes to the app.config file and have it propogated. With the release of VS.NET 2003, us C# developers now have pre and post build steps. So I now have to remember to add the following to the post-build event:
I have been thinking a lot about how Typed DataSets are generated and was spelunking through the code again when it got me thinking. The Typed DataSet generator doesn't really generate the code based on the .xsd, but on the DataSet. It simply loads the .xsd into a DataSet then interrogates the DataSet directly for everything (tables, columns, relationships, constraints). So if the Typed DataSet Designer cannot handle something (like relationships *without* constraints, see below), but the DataSet schema allows it...simply create the DataSet and save the .xsd file to see what it produces! This gets around some fundamental problems with the designer. It does require you start looking and understanding .xsd, but it is a useful skill to have anyway...right?
I hear from a lot of readers that they are creating 3-tier ASP.NET apps and I always wonder if they know where the middle tier is.
I hope I am not the only one who missed the magic of CTRL-SHIFT-V. I have bungled about with copy-paste in the editor so many times...I accidently hit CTRL-C instead of CTRL-V and copy an empty line instead of pasting my code...Arg! Now I know to just hit CTRL-SHIFT-V and pick my lost copy from the clipboard ring.
Url: http://msdn.microsoft.com/vstudio/partners/
Url: http://www.codeproject.com/managedcpp/Quake2.asp
In the last few weeks a number of comparison between Java and .NET have been floating around. As much as I am interested in these comparisons on an intellectual level, I really don't care on a practical level. Do most day-to-day developers really care? Sure, the number of jobs out there for any particular skill set move with the tides so most of us care. But on a purely technological comparison, the differences is minimal.
I just attended the second day of Chris Sells' and Tim Ewald's great Web Services DevCon East and had a great time. Yasser Shohoud gave a wonderful talk on "The Right Way to Build Web Services". He echoed something I have been thinking of for some time. Sure, I didn't want to learn how to write WSDL. At the same time I know that the WSDL that is generated by using the '?wsdl' syntax of ASP.NET's .asmx files does not let me design the interface first. I changed my mind and learned to write WSDL. WSDL really isn't too difficult to write. It is too bad that we cannot disable the ?wsdl syntax and just use a static WebService.WSDL URL to have our customer's get our WSDL files.
Why is everyone so down on using DataSets in .NET Web Services? Sure, I’ll admit that using DataSets directly as Web Service parameters are indeed a problem. But why throw the baby out with the bath water?
I was recently in a DevelopMentor course when I ran into a very interesting observation. The XmlSerializer serializes any class that dervies from XmlNode (including XmlDocument, XmlElement, et al) as plain XML. Previous to RTM of the .NET framework, these classes were serialized like any other class (all public properties and fields were serialized). To our amazement (Dan Sullivan and mine), we realized that the XML classes serialized perfectly when run through the XmlSerializer class.
When the XML revolution happened, I was surprised how quickly developers jumped on to the coming tide. I have to admit, the first time I saw XML, I believed it was nothing more than just structured storage. That is the magic of it, isn't it. It is just structured storage, but a structured storage format that is universally understood.
For those who do not know yet, the XML integration with the DataSet is very powerful. Most of the integration is about filling and getting XML from your DataSet. But the XmlDataDocument is really cool. Simply by assigning the DataSet to the XmlDataDocument, you can work with the DataSet data either relationally (through the DataSet) or hierarchically (through the XmlDocument). So, next time you need to transform the DataSet data or just run an XPath query, assign your DataSet to an XmlDataDocument and watch the magic begin...