|
Does anyone have any good SignalR resources? Or has anyone used SignalR and can provide some feedback? I'm trying to send messages with different subsets of a dataset to different clients and I'm not seeing any good guides on how to do that. As an example, I'd like to update stock quotes only for stocks in a given clients portfolio rather than just send all stock quotes and have the client decide which ones to display. I'm not sure that SignalR is the right method for this task but I wanted to play around with it and this seemed like a decent learning application to try.
|
# ¿ Jul 14, 2014 16:01 |
|
|
# ¿ May 7, 2024 02:31 |
|
seregrail7 posted:I've worked on something similar where I need to push out data from a data set where it's different content for each user. What I did was treat the user as a group using their ID as the group name and then build up the data that they should see and send just that in the update(I presume if you're dealing with user portfolios you have what they should see stored some how). You will be repeating some of the data you send out for sure but it was the least messy method I could come up with. I set up a Hub to deal with security for users connecting and handling all the updates to the dataset since it's all data that's constantly changing. How did you keep the service alive to push changes to users? All of the examples that have used timers have been for SignalR 1.0 which registered the service in global.asax to keep the service alive. The 2.0 examples using OWIN startup seem to use RX. Ideally though, I'd like it not to be timed. As in I get a message with a quote tick that pushes to the hub/persistent connection which pushes to the client. However, it seems like SignalR doesn't support that or my RX skills aren't very strong.
|
# ¿ Jul 15, 2014 19:49 |
|
seregrail7 posted:It was SingalR 1 that I used and I followed this guide: http://www.asp.net/signalr/overview/signalr-1x/getting-started-with-aspnet-signalr/tutorial-server-broadcast-with-aspnet-signalr Hey thanks. I think that example would be better to carry over into SignalR 2. Previous articles I read seemed to require a timer to be a registered object to keep the server alive which I'm not sure if I can do in SignalR 2.0 since it's not activated through a global.asax. I'm still playing around with setting up a pub/sub message bus because that would seem to fit a true quote stream scenario better than a timed update, but this is a good start too.
|
# ¿ Jul 16, 2014 15:10 |
|
Volte posted:There is strong reason to believe that Xamarin will be part of Visual Studio in the not too distant future, so there's still hope. Yep. There were some acquisition rumors in the spring. Nothing recently though but it would make sense. I wonder if they'll include it in the base Visual Studio license or it will still be a additional license to buy.
|
# ¿ Jul 30, 2014 15:39 |
|
Ithaqua posted:It's an event handler, so it can't return a Task. Could you drop this out into a thread-safe helper class? That's how I've been working with hubs and I'm able to trigger async void events for timer ticks and such.
|
# ¿ Aug 14, 2014 21:23 |
|
Ithaqua posted:Could you give me a 10-line repro of what you're talking about? I tried something similar last night with no luck, but I may have been missing something because I was doing it after driving for 3 hours. I basically used the StockTickerHub example and changed it to meet my needs: code:
code:
|
# ¿ Aug 15, 2014 15:30 |
|
Can anyone point me in the right direction with the Identity framework for Web API services? I have the authentication piece set up using OAuth bearer tokens, but I need help on setting up user based authorization. I would like to make sure that a user has access to their own data and no one else's. However, when using bearer tokens the user name is never sent to the service and I Identity.Name is blank. I'm wondering how I would send along a User name and validate it against a token (or password if token's aren't the right approach) so that a user can only access their own data. I don't have much experience with security and this is for a personal project that I'm doing to learn a bit more. Edit: I recreated the project with the individual user account authorization and now I get a username generated from the bearer token. I was creating basic authentication from scratch using a tutorial I found related to angular online but it wasn't embedding the username in the token. As a side note, does anyone find it annoying that Visual Studio won't allow a Web API project to be created without including the MVC component? You can create an empty project but then it won't allow for an authentication setting otherwise you need to create a joint Web API MVC project. I had to clean out all of the MVC stuff after the project was created which was pretty annoying. Ochowie fucked around with this message at 17:32 on Sep 10, 2014 |
# ¿ Sep 10, 2014 15:21 |
|
RangerAce posted:Yes! It is very bad, almost all the time. From your Link posted:In theory, JavaScript does not have classes. In practice, the following snippet of code is widely considered to be an example of a “class” in java script: I think you're underestimating the extent this is written for JavaScript devs...
|
# ¿ Sep 25, 2014 22:04 |
|
Cross posting from an SO question I started. Is there any way to simulate foreign key checks when unit testing a Repository on top of EF using Moq? I have the following code which should technically fail because one of the relationships isn't present in either the database or the mocked sets on the context. I have the following code which I would expect to fail because the foreign key reference is not in the context but it succeeds adding and verifying that SaveChanges() is called on the DbContext.code:
|
# ¿ Oct 7, 2014 20:17 |
|
gariig posted:How would a fake DbContext know that your relationship should fail? It's just going to let your code call into it, return pre-recorded behavior (Setup/Returns), and to allow you to Verify calls. If you want to test what happens when your code gives a bad relation you can have Moq throw an exception. I guess I assumed that if I mocked up the DbSets and passed them to the context that some of the context behaviors would carry over. I guess that that doesn't make a lot of sense. I guess I'm more familiar and comfortable with the integration testing concept over the unit testing one. Thanks for the reading recommendation.
|
# ¿ Oct 7, 2014 23:33 |
|
gariig posted:It depends on what you want to test. I've honestly not done much EF. Can you mock a DbContext and still get information like invalid FK like Ochowie wanted? I'm too lazy to go look up the information. I could see some uses for it. Certainly for simulating queries or other downstream logic, or for testing error handling like RICHUNCLE mentions. It seems like unit testing a repository add method doesn't seem like it adds much value without FK checking. Originally, I foolishly thought that any non-mocked methods would revert to their regular implementation. Also, I thought that FK checking would be done by the DbSet add method instead of the SaveChanges.
|
# ¿ Oct 9, 2014 02:51 |
|
So I have an f# question. Has anyone done pattern matching on .NET types using the :? operator? I'm using f# to do some financial calculations on a list of various types derived from a base class and calculations need to be performed based on the derived type. I could give each of them a calculate method and use polymorphism but I was intrigued by the ability in f# to pattern match on type.
|
# ¿ Oct 13, 2014 17:23 |
|
Destroyenator posted:It works pretty much like you'd expect but stylistically it sounds like this is when you should use polymorphism. I know I should, but these are POCO EF entities and I feel dirty putting what is essentially business logic right on the entity class. Transferring them to DTOs would essentially require the same kind of type checking since i would get a list of base objects and want map them to a list of DTOs.
|
# ¿ Oct 14, 2014 13:51 |
|
Destroyenator posted:Well you know the codebase better than any of us and it's partly a personal preference thing, try it out and see how it feels? Think about how often a new sub-type will be written, how many different places you'll need to put switching logic and whether you're setting a precedent (either way). Yeah this is just a personal project I'm doing for learning purposes. Part of what's bugging me is that using polymorphism with a calc method on each object seems the most obvious but it introduces weird object dependencies that I don't like and I've been struggling for a clean way of processing a heterogeneous list of derived objects in this case and the f# pattern match seems like an interesting solution.
|
# ¿ Oct 14, 2014 16:27 |
|
GrumpyDoctor posted:Is there a way to use discriminated unions? One option would be to create a union parallel to the class hierarchy, which is kind of a smelly duplication of work but moves the potential runtime error to a compile-time one. I've thought about that since I want to play around with some concepts from a paper on financial contract combinators. Buy wouldn't I still need to pattern match the original type to create the union type?
|
# ¿ Oct 14, 2014 17:09 |
|
Mr Shiny Pants posted:If you are using F#, why not use a Type Provider instead of EF? Honest question. I guess I could. I started with EF to do CRUD type stuff for this project so that was there before.
|
# ¿ Oct 16, 2014 15:25 |
|
This is from a few pages back, but what is the difference between VS Community and Pro? On the Website it says it's a version of the Pro products optimized for small teams but I'm not sure what that means. Are there features that are left out or are they realigned to support smaller teams?
|
# ¿ Nov 28, 2014 15:45 |
|
crashdome posted:I develop entirely on a Surface Pro 2 (1920x1080 10.6" screen). I have a separate 21" monitor on a workbench which helps a little when I'm debugging but, I get by. I've really been trying to get my work to give me a Surface Pro 3 instead of our lovely HP laptops. I already have daisy-chained display port monitors so I could use the dock that they sell as an accessory. I really want it for the active digitizer. I can't believe Apple hasn't given in on that for the iPad.
|
# ¿ Dec 9, 2014 21:47 |
|
crashdome posted:I'm pretty sure its because the usefulness would be limited. It's not like you can run full Photoshop on the iPad. Even on the surface it's not my go to input device. It's pretty rad to bust out the stylus and collapse the keyboard once in awhile though. Not to go on too much of a derail of the thread but I just want to take notes on the iPad. There are such great note taking apps but all the stylii suck with writing with your finger being the only thing worse. The reason they haven't done it is because Steve Jobs hated stylus based navigation, but I don't think anyone is asking for that.
|
# ¿ Dec 10, 2014 01:16 |
|
Bognar posted:Wow, what design decisions were made there that caused generics to be slower? I thought C# generics were just syntactic sugar for the compiler to create additional classes at compile time. There shouldn't be any reason that those are significantly slower (I say from my armchair). I was about to ask the same thing. Are there any articles that back this up? This seems really bizarre to me. Hopefully it changes when MS sacks up and buys Xamarin.
|
# ¿ Dec 29, 2014 07:19 |
|
Gul Banana posted:Yeah, I had a conversation with David Fowler. He stated pretty clearly that they're not going to support languages other than C# in KRuntime projects (actual asp.net sites and new-style class libraries). I haven't used VB since v1 of the .NET framework before I learned C#, but drat that is an incredible departure from the original principles of the .NET framework.
|
# ¿ Feb 4, 2015 19:58 |
|
Gul Banana posted:The impression I got from talking to some of the developers was that they're committed to enabling things which were just impossible before - side by side installs, cross-platform support, fine-grained versioning (and therefore first-class package management). In order to do that, they're making sacrifices. In a way, it's the same old Microsoft story - reaching for the markets you *don't* have, because that's where the growth is! Still, I don't think they've made a bad decision overall. The combination of the new runtime and new build systems really open up the possibilities for .NET, and the old stuff will work 'forever' in the same sense that e.g. winforms and webforms are still supported today. It seems like Microsoft is trying to reach out to an audience that will never accept it. I'm just not sure how much the open source/web development community is going to embrace these technologies as long as it has Microsoft associated with it. As a C# user (hell, I don't even remember VB.NET syntax well enough to write it right now) I see a lot of benefit to this approach as well, however, as an F# user I am really sad that they're not including it (demonstrating once again its second class status). At the risk of sounding hysterical, how log before .NET core ditches C# for Typescript to continue chasing this community of developers that will never give it the time of day?
|
# ¿ Feb 4, 2015 21:39 |
|
Bognar posted:I consider the annoying squiggles a feature - just fix whatever is causing your squiggles or turn off that inspection rule if you don't care about it. There's nothing I enjoy more than turning that ReSharper box in the top right into a green check. I've posted this in the IDE thread for other JetBrains products and it's valid here too. I find their default validations to be way too aggressive. Things like typo checks should not be on by default (in my opinion). Also, some of the loop to linq conversion suggestions don't make a whole lot of sense and often produce code that is less clear (again in my opinion). It has a lot of useful tools but I wish it wasn't so in my face about certain things and I don't need to hunt around and turn things off individually.
|
# ¿ Feb 11, 2015 17:40 |
|
bpower posted:I love the x to linq stuff, it basically taught me linq with zero effort on my part. Nothing against you personally, but that's why I would prefer that feature by disabled by default.
|
# ¿ Feb 11, 2015 18:16 |
|
This might be a dumb question but what's the intended deployment scenario with ASP.NET 5.0 (previously vNext)? The documentation states that it can be self hosted or hosted in IIS. So that leaves me wondering if the intended Mac and Linux deployment scenario is really supposed to be the self hosting approach. I always thought this sort of thing was for development and debugging only (kind of like Flask self-hosting) and that production should go through Apache or NGinx or something.
|
# ¿ Feb 25, 2015 17:10 |
|
RangerAce posted:Is "self-hosted" a euphemism for "hosted on OWIN"? I guess. They didn't call OWIN out by name but I guess that's what it would be. Gul Banana posted:they're writing a libuv-based http server named Kestrel Interesting. I'll dig around for that.
|
# ¿ Feb 26, 2015 03:25 |
|
I've started playing around .NET Core and ASP.NET 5 on Linux and I've run into some issues/confusion. The thing I'm confused about the most is the difference between DNX and .NET Core (as executed by the dotnet command). I tried running the sample hello world application using just .NET Core (I think) on Ubuntu 15.04 and it failed because it couldn't find System.Console (which is a known issue). However, if I run the same setup using DNX it works without issue. So my question is, which framework is DNX using in the background? Is it it my Mono install or is it still using .NET Core but accessing it in a different way? It's also possible that I'm totally offbase with this. This is the project.json for reference:code:
|
# ¿ Dec 16, 2015 22:05 |
|
EssOEss posted:The way I think about it is that .NET Core is a set of interfaces/APIs that are exposed by various products called CoreFX (often used with the DNX runtime; which... I think... is the same as CoreCLR) and the Base Class Library (often used with the .NET Framework runtime). To "run something with .NET Core" makes no sense to me - it is not a piece of software, though it is implemented by various pieces of software. I guess then my question would be, what's the difference between executing something using the dotnet run command vs. through DNX. I assumed that the dotnet version always invokes CoreCLR while DNX is more of an abstraction that could use different versions of the CLR in the background. The interesting thing is, I checked which runtime DNX was using (via DNVM) and it was previously using Mono. After I changed it to use CoreCLR my hello world application still ran correctly. So it leaves me even more confused about why it would run using DNX but not using the dotnet command.
|
# ¿ Dec 16, 2015 23:41 |
|
Ithaqua posted:
Even so, paying upwards of $1000 and then seeing ads is ridiculous. Same with Azure. If Google can make a basically ad free experience in their cloud platform why can't Microsoft? Ochowie fucked around with this message at 07:41 on Jan 22, 2016 |
# ¿ Jan 22, 2016 01:02 |
|
uncurable mlady posted:Because Microsoft is run by insane howling gibbons who demand maximal revenue from every possible source. So much for the new Microsoft.
|
# ¿ Jan 22, 2016 07:37 |
|
epalm posted:That new Microsoft release candidate that supposedly runs on Linux is probably not the thing you want. It seems like now is a particularly bad time to try this out since it's being migrated from running on DNX/DNVM to the new dotnet CLI. It seems like it would make sense to wait a bit for RC2 to come out and be more or less stable before trying this.
|
# ¿ Feb 2, 2016 19:40 |
|
xgalaxy posted:Jet Brains C# IDE is out for early access (aka beta). I'm excited to check it out. While running Visual Studio on OS X via parallels is an okay experience it would be nice to have something that offers a bit of a smoother ride performance wise. I hate MonoDevelop. I've used IntelliJ before and loved it for Java programming. I'm curious how this will play out in the long run. They've built it as a wrapper around calls to Resharper which seems a bit different from their normal IDE's.
|
# ¿ Mar 4, 2016 01:13 |
|
Drastic Actions posted:It's called Project Rider. Rider doesn't support .NET core yet...
|
# ¿ Jun 28, 2016 22:06 |
|
Inverness posted:
I remember reading that they had to do a bunch of really ugly hacks to get WPF to work on a project as large as Visual Studio.
|
# ¿ Jun 28, 2016 22:25 |
|
Inverness posted:I want to know more about this. I can't find the original source but here https://www.youtube.com/watch?v=aWqg55ejoss is a video about the migration.
|
# ¿ Jun 28, 2016 22:49 |
|
I'm playing around with .NET on Linux and I'm wondering how to import a locally built class library into another project. I'm trying to import a dependency that can be built with .NET core but the nuget package hasn't been updated to support core yet.
|
# ¿ Jul 13, 2016 22:14 |
|
Gul Banana posted:there's an imports: key available in project.json which lets you override what a package claims to support. use with care though, bc if it really isn't compatible you're in for a runtime crash Yeah, that's part of the problem. I don't think the version that's on NuGet will work with core. However, the version that I built from Github does. I just don't know how to integrate that version.
|
# ¿ Jul 14, 2016 17:28 |
|
Gul Banana posted:oh! right. if you built it in the same solution, you can reference it as a dependency with {"target": "project"} instead of a version number (in visual studio the gui will let you do this via 'add reference'). otherwise, dotnet pack/nuget pack it into a nupkg and put that in a local folder package source or on myget or something. Thanks for this. So I ran dotnet pack on the repo, but I can find the nupkg anywhere. Do you know where it outputs to? I'm thinking part of the problem is that this library technically compiles for .net standard instead of .net core so I wonder if that's what is tripping me up? Edit: Also, what is the connection between applications targeting the .NET Standard and .NET Core? Can I use a .NET Standard library from a .NET Core app? Also, I can't seem to make a .NET Standard console application (maybe that's because I'm running a version of Linux, Ubuntu 15.10 that's not supported by .NET Standard?). Ochowie fucked around with this message at 22:36 on Jul 14, 2016 |
# ¿ Jul 14, 2016 21:10 |
|
Gul Banana posted:netstandard is for libraries only, not apps. it's like an interface which is implemented by actual platforms, of which .net core (netcoreapp) is one. Thanks for this. Am I correct in assuming that libraries anything that can build to netstandard <= 1.6 can be used by a netcoreapp1.0 console application? I've run into something strange where the library I'm trying to build from source targets netstandard1.5 but depends on a library that isn't supported by netcoreapp1.0 (IX-Async) and I'm not sure how that's possible?
|
# ¿ Jul 15, 2016 18:53 |
|
|
# ¿ May 7, 2024 02:31 |
|
Gul Banana posted:your understanding of netstandard is correct. it's possible the author of the library used imports.. do you have source somewhere? You mean in the Frameworks section? If so, then yes, it imports portable-net45.
|
# ¿ Jul 15, 2016 19:19 |