Suggestions on how best to move from Nancy to ASPNet Core?

%3CLINGO-SUB%20id%3D%22lingo-sub-2958969%22%20slang%3D%22en-US%22%3ESuggestions%20on%20how%20best%20to%20move%20from%20Nancy%20to%20ASPNet%20Core%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2958969%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20have%20a%20Framework%20solution%20which%20has%20two%20projects%20that%20run%20on%20Nancy.%26nbsp%3B%20And%20since%20Nancy%20is%20dead%20we%20need%20to%20migrate%20to%20something%20else%2C%20and%20I%20want%20that%20to%20be%20on%20Core.%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BHas%20anyone%26nbsp%3B%20done%20this%20before%2C%20and%20do%20you%20have%20any%20suggestions%3F%3C%2FP%3E%3CP%3EOne%20daunitng%20task%20is%20simply%20changing%20all%20the%20endpoints%2C%20things%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet(%22%2F%22%2C%20args%20%3D%26gt%3B%20%7B%20return%20GetJobToRun()%3B%20%7D)%3B%3CBR%20%2F%3EPost(%22%2F%22%2C%20args%20%3D%26gt%3B%20%7B%20return%20AddNewJob()%3B%20%7D)%3B%3C%2FP%3E%3CP%3EGet(%22%2Fshuttle_info%22%2C%20args%20%3D%26gt%3B%3CBR%20%2F%3E%7B%3CBR%20%2F%3Evar%20results%20%3D%20Shuttles.Select(v%20%3D%26gt%3B%20v.Value).ToList()%3B%3CBR%20%2F%3Ereturn%20results%3B%3CBR%20%2F%3E%7D)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22dlwiii_0-1636730374883.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F326641iC81C08184C5BD83B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22dlwiii_0-1636730374883.png%22%20alt%3D%22dlwiii_0-1636730374883.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20about%20200%20such%20declarations.%26nbsp%3B%20So%20looking%20for%20the%20smoothest%20way%20to%20transition%20to%20...%26nbsp%3B%20I%20really%20don't%20know%20what.%26nbsp%3B%20MVC%20has%20way%20too%20much%20ceremony.%26nbsp%3B%20Is%20there%20a%20nice%20core%20framework%20that%20allows%20us%20to%20cleanly%20easily%20declare%20paths%20and%20http%20methods%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3CP%3EDaniel%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2958969%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EASP.Net%20Core%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2963454%22%20slang%3D%22en-US%22%3ERE%3A%20Suggestions%20on%20how%20best%20to%20move%20from%20Nancy%20to%20ASPNet%20Core%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2963454%22%20slang%3D%22en-US%22%3ENancy%20and%20Minimal%20APIs%20in%20.NET%206%20have%20a%20lot%20in%20common.%20You%20should%20see%20how%20Minimal%20APIs%20work%2C%20you%20should%20be%20able%20to%20craft%20a%20solution%20that%20keeps%20your%20business%20logic%20likely%20untouched.%3C%2FLINGO-BODY%3E
New Contributor

We have a Framework solution which has two projects that run on Nancy.  And since Nancy is dead we need to migrate to something else, and I want that to be on Core.     Has anyone  done this before, and do you have any suggestions?

One daunitng task is simply changing all the endpoints, things like this:

 

Get("/", args => { return GetJobToRun(); });
Post("/", args => { return AddNewJob(); });

Get("/shuttle_info", args =>
{
var results = Shuttles.Select(v => v.Value).ToList();
return results;
});

 

dlwiii_0-1636730374883.png

 

We have about 200 such declarations.  So looking for the smoothest way to transition to ...  I really don't know what.  MVC has way too much ceremony.  Is there a nice core framework that allows us to cleanly easily declare paths and http methods?

 

Thanks!

Daniel

 

 

3 Replies
Nancy and Minimal APIs in .NET 6 have a lot in common. You should see how Minimal APIs work, you should be able to craft a solution that keeps your business logic likely untouched.

@shawnwildermuth  Thank you !  I will give it a try.  This will get me the simpler routings, but then is it just a matter of telling those endpoints to go to a CSHTML view?

 

 

@dlwiii If you're using Nancy for Routing to Views (not just APIs), then you'll want to dig into Razor Pages. That will allow you to do something similar.