7 ms·
MVC5 still not working tho. Good thing we have Nancy. Edit: Seems like many do not know about Nancy, check it out, some even say it's better than MVC. The good
by romanovcode 13y ago
MVC5 still not working tho. Good thing we have Nancy.
Edit: Seems like many do not know about Nancy, check it out, some even say it's better than MVC. The good side is that it's 100% compatible with Mono because they run tests against it too so you can host your C# websites on Linux.
Github: https://github.com/NancyFx/Nancy https://github.com/NancyFx/Nancy
- rjzzleep 13y agodidn't know mvc5 was out. but i can tell you mvc4 with f# was nifty weeeee (as nifty as mvc can possibly be anyway)
- skrowl 13y agoFirst time I've heard of Nancy. Anyone got a URL since it's name is so terrible that you can't google it?
- Yuioup 13y agoI had the same problem. I googled "Mono Nancy" and eventually found this: https://github.com/NancyFx/Nancy https://github.com/NancyFx/Nancy EDIT: It seems to be a .NET clone of node.js
- skrowl 13y ago.NET clone of node.js would be nice, because I like the idea of node.js but not enough to ditch all my .NET stuff (especially entity framework).
- chadzawistowski 13y agoEdge.js might interest you. It's an interop library for .Net and node.js: http://tjanczuk.github.io/edge/#/ http://tjanczuk.github.io/edge/#/
- tracker1 13y agoI think that the LINQ integration with EF is nice.. but EF in and of itself isn't all that great imho... Most of what it does is generate types to correspond to your database tables. When you use a language with real variable types, it's less of an issue... If you really want it, you could shoehorn generators and other db platforms into the hyena[1] package. In general, I've found that using databases tend to be much more straight forward under node, and that using ORM tools are less necessary. [1] https://www.npmjs.org/package/hyena https://www.npmjs.org/package/hyena
- j_s 13y agoC# (.NET4+) has real variable types, and a library to use them for database access. Using Type dynamic - http://msdn.microsoft.com/en-us/library/dd264736.aspx http://msdn.microsoft.com/en-us/library/dd264736.aspx https://github.com/robconery/massive https://github.com/robconery/massive
- tracker1 13y agoWhen you use dynamic, you lose the biggest advantage of C# in general, intellisense in VS. Don't get me wrong, it can be great to use dynamic at times... I just feel you're losing the advantage that VS/C# give you when you do, so you may as well be using something else. (I like node.js)
- lucian1900 13y agoThere's nothing in node.js that you can't get with .NET/Mono except for JavaScript, and even if you must run JS for some reason there are some solutions (like IronJS).
- nbevans 13y agoEntity Framework is really not a good excuse. .NET has lots of great things going for it. Entity Framework is firmly on the "enterprise .NET" list of such items though. .NET has always been able to do what Node does anyway. It has had HttpListener since v1.0...
- mattmanser 13y agoThink you'll be getting a shock in a couple of years if you think the EF is enterprise. It's changed massively and coding without it is becoming a little like coding javqscript without jQuery. You can do it, but why bother writing all those crud operations yourself?? Even with complicated SQL you can hand roll it and then tell the EF which class you're.returning and it'll handle all the boring `rs.GetInt(rs.GetOrdinal("ID"))` crap.
- PallarelCoedr 13y agoOWIN will give some of what you are looking for.
- martydill 13y agoI started something along these lines a while ago. Haven't touched in quite some time though. https://github.com/martydill/node.fs https://github.com/martydill/node.fs
- JohnBooty 13y agoNo, it's a Sinatra-inspired framework for .NET ...and it's quite good! (Thus the name. Frank Sinatra's daughter is named Nancy Sinatra)
- rjzzleep 13y agono it's not. it's a .NET clone of sinatra. it's a web framework. it has little to nothing to do with node.js. although .net have pretty powerful multiprocessing and async routines, and can therefore be connected to node.js without too much effort.
- skrowl 13y agoHow does it compare to Web API?
- JohnBooty 13y agoNancy, like Sinatra, is a general-purpose web framework. You could implement an API in it, or you could implement a user-facing website. Nancy and Sinatra are typically used for smaller sites. They're based around routes, controllers, and views but they don't (for better or worse) lock you into an MVC project structure like ASP.Net MVC or Rails. Web API, by comparison, is pretty much "just for implementing a web-based API" and not something you'd want to use for a user-facing web application that serves up HTML pages.
- hhandoko 13y agoServiceStack [1] is a closer comparison to Web API. A lot easier to set up and runs in Mono, but not free (although it is open source [2]). [1] - http://servicestack.net http://servicestack.net [2] - https://github.com/ServiceStack/ServiceStack https://github.com/ServiceStack/ServiceStack
- brokenparser 13y agoIf you don't mind me asking, I'm stuck trying to get the project templates to work with Monodevelop 4. I'm using this repository to run the latest Mono and Monodevelop on Fedora: http://download.opensuse.org/repositories/home:/tpokorra:/mono/Fedora_20/ http://download.opensuse.org/repositories/home:/tpokorra:/mo... When I open the vsix file, all I get is a hexdump. I also tried installing it as an add-in, but it doesn't appear to accept vsix files. The goal is to get past step one of these instructions: https://github.com/NancyFx/Nancy/wiki/Introduction https://github.com/NancyFx/Nancy/wiki/Introduction How to make this work, pretty please?
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- Thieum22 13y agohttp://nancyfx.org/ http://nancyfx.org/
- deleted 13y ago[deleted]
- profquail 13y agoI haven't tried them yet, but here are some directions I found (on /r/dotnet) a few days ago for tweaking MVC5 so it runs correctly on Mono: http://curtis.schlak.com/2014/02/04/setup-asp-net-mvc-4-on-monodevelop-4.2.html http://curtis.schlak.com/2014/02/04/setup-asp-net-mvc-4-on-m...
- Xdes 13y agoWhat *nix needs is an OWIN compatible web server.
- oblio 13y agoFrom the FAQ: https://github.com/owin/owin/wiki/faq https://github.com/owin/owin/wiki/faq - OWIN is inspired by rack, WSGI and node.js. I'd say there are plenty of alternatives to OWIN (and the .Net stack) for *nix. That's probably why there's not much interest around Mono, too.
- jongalloway2 13y agoI've heard Nowin runs well on Mono (haven't tried it yet myself). https://github.com/Bobris/Nowin https://github.com/Bobris/Nowin
- wintersFright 13y agoMiguel tweeted this a week ago: NoWin, Nancy, SignalR & Lego on the raspberry pi: https://www.youtube.com/watch?v=s_ZQtiupyzE https://www.youtube.com/watch?v=s_ZQtiupyzE
- damianh 13y agoThere is also Fos (FastCgi Owin Server) https://github.com/mzabani/Fos https://github.com/mzabani/Fos
- brokenparser 13y agoNeat! It even almost works! http://i.imgur.com/f1HjoNW.png http://i.imgur.com/f1HjoNW.png SO close...
- voltagex_ 13y agoLooks like the Owin dependencies didn't come down - does NuGet run under MonoDevelop?
- manuletroll 13y agoNancy is indeed an excellent framework, I use it for practically every web project at my day job these days.
- yawgmoth 13y agoOn [1], what does the underscore mean? public SampleModule() { Get["/"] = _ => "Hello World!"; } [1] http://nancyfx.org/ http://nancyfx.org/
- ntnj 13y agoUnused parameter for lambda function.
- SideburnsOfDoom 13y agoThis is the most accurate reply. The expression Get["/"] = _ => "Hello World!"; is actually of the form a = b; Where "a", i.e. "Get["/"]" is an array-like property (http://msdn.microsoft.com/en-us/library/2549tw02.aspx http://msdn.microsoft.com/en-us/library/2549tw02.aspx ) and the "b" value assigned to it is an anonymous function with one parameter, i.e. _ => "Hello World!" In Nancy these handlers are of the type Func<dynamic, dynamic> ( http://msdn.microsoft.com/en-us/library/bb549151(v=vs.110).aspx http://msdn.microsoft.com/en-us/library/bb549151(v=vs.110).a... ) The parameter could be given any legal name, but an underscore is a convention meaning "I am not using this param".
- damianh 13y agoIt's the 'Dynamic Dictionary' [0]. It's usually called 'parameters' but it's idiomatic in dotnet to name lambda input parameter '_' if don't use it in your expression. [0] https://github.com/NancyFx/Nancy/wiki/Taking-a-look-at-the-DynamicDictionary https://github.com/NancyFx/Nancy/wiki/Taking-a-look-at-the-D...
- romanovcode 13y agoIt's dynamic path element. public SampleModule() { Get["/{id:int}"] = _ => { int id = _.id; return "Parameter ID is: " + id.ToString(); }; }
- JohnBooty 13y agoAs others have said, it's idiomatic to name a lambda param "_" if you're not using it. To perhaps clarify a bit, here's what the Hello World example would look like if we added a second route that uses the lambda parameter, and a third route that does something else, and a fourth route that renders a view template. public SampleModule() { Get["/"] = _ => "Hello World!"; Get["/hello/{name}"] = p => ("Hello, " + p.name + "!"); Get["/something-complicated"] = _ => { // complicated stuff happens here return "OK... we're all done"; }; // A variety of template engines are supported Get["/my-resume"] = _ => View["resume.cshtml"]; }
- antihero 13y agoHow does Nancy stack up to ServiceStack?