|
epalm posted:This is how I do it. I have Services (what you just referred to as Managers) which represents The App (which is its own VS class lib) which sits in between the UI (an ASP.NET controller, a WPF viewmodel, etc) and a datastore (SQL Server, WhateverNoSql, InMemoryMock, etc). I end up with app.dll which contains all the services and business logic and has no references to anything but does define repository interfaces, data.dll has a reference to app.dll and implements the interfaces in whichever way it needs to (entity framework, for example), and at that point you can tack on an ASP/Console/WPF project which has a reference to app.dll (and probably to data.dll if you're doing IoC just to specify which datastore your app wants to use). See, I like the way this sounds. I already have separate projects for my Domain and my UI, but my data access layer is folded into the domain. It arguably belongs there, but I think it's been muddying my mental waters a bit when it comes to thinking about where certain operations belong. Explicitly separating the data layer may help me with that, even if it does introduce extra complexity when it comes to the other data operations (which don't at the moment require extra calculation the way adding an Item does).
|
# ? Jan 24, 2014 20:32 |
|
|
# ? Jun 4, 2024 22:26 |
|
Dietrich posted:I don't know. The Repository should know how to ferry data to and from a database, and that's pretty much it. It doesn't really seem like a calculation you can efficiently perform in memory in the general case, though - what could the repository-agnostic input be, other than "a list of all the SKUs currently in use"? Or am I misunderstanding what you're suggesting? This is going to be a trade-off between efficiency and having your business logic in code. In this case I would err on the side of efficiency because it's a very simple but data-intensive calculation that admits quite a lot of database optimization. There are definitely situations where I would give up some efficiency for the sake of keeping logic in code, though.
|
# ? Jan 25, 2014 03:27 |
|
I started playing with SignalR tonight, it's pretty neat. Any ideas on best practices for actually using it in conjunction with WebAPI? I have an idea for a goofy little game.
|
# ? Jan 26, 2014 04:01 |
|
I've got a WPF control with a bunch of buttons and a "description" label. I want the description text to be updated whenever a button is hovered (with an explanation of what the button does). What's the best way to do this? Some kind of trigger wizardry? Just saying "gently caress it" and writing two code-behind events for each button? Binding directly to IsMouseOver isn't possible, apparently.
|
# ? Jan 27, 2014 00:54 |
|
Che Delilas posted:Right now the new Items are being created by the ASP.NET MVC model binder (i.e. behind the scenes when the user posts the form). Is it possible to modify or replace the model binder with something that could use an ItemFactory? Simple answer: don't do it. The problem here is that you've got a domain model as an Action method parameter. Change your method signature to accept all the primitive types that you need to instantiate an item and pass that to a factory on your own (or a service/manager/whatever).
|
# ? Jan 27, 2014 15:57 |
|
Ithaqua posted:I started playing with SignalR tonight, it's pretty neat. Any ideas on best practices for actually using it in conjunction with WebAPI? I have an idea for a goofy little game. I'm actually wondering this too. I have a pet project I'm about to bring SignalR into, and am just thinking of ditching the MVC controller I'm using for data services and using SignalR for everything. Websockets just make more sense for implicit/instant saves, which I'm wanting to move to.
|
# ? Jan 27, 2014 17:16 |
|
GrumpyDoctor posted:I've got a WPF control with a bunch of buttons and a "description" label. I want the description text to be updated whenever a button is hovered (with an explanation of what the button does). What's the best way to do this? Some kind of trigger wizardry? Just saying "gently caress it" and writing two code-behind events for each button? Binding directly to IsMouseOver isn't possible, apparently. I think you could do something similar to this attached behavior solution: http://znite.wordpress.com/2010/02/20/mvvm-mouseover-binding/.
|
# ? Jan 28, 2014 00:42 |
|
I was under the impression that with Entity Framework I could eagerly load to my heart's content, but I'm not seeing that happen. I thought I could just do this:code:
I'm trying to make 1 call to sql to get all of the data I need but unfortunately I'm making the first and then 2 for every enumeration on the entityList. Is there no way to force EF to load all this data?
|
# ? Jan 28, 2014 01:45 |
|
GoodCleanFun posted:I think you could do something similar to this attached behavior solution: http://znite.wordpress.com/2010/02/20/mvvm-mouseover-binding/. This is close, but I don't know enough WPF to be able to extend it. My problem is that he's binding an item (a Person) in his ListBox to his viewmodel's CurrentPerson property, and using properties of that Person to generate his description text, but I want to use Button objects, which don't have description text. I guess I could roll my own "Button-with-description-text" subclass, but that seems overkill.
|
# ? Jan 28, 2014 17:31 |
|
Maybe just hijack one of the string Dependency Properties like ToolTip? Put the description in there. I think there are ways of disabling or hiding tooltips. Then use theButton.ToolTip in whatever binding you need.
|
# ? Jan 28, 2014 19:30 |
|
GrumpyDoctor posted:I've got a WPF control with a bunch of buttons and a "description" label. I want the description text to be updated whenever a button is hovered (with an explanation of what the button does). What's the best way to do this? Some kind of trigger wizardry? Just saying "gently caress it" and writing two code-behind events for each button? Binding directly to IsMouseOver isn't possible, apparently. XML code:
|
# ? Jan 28, 2014 21:05 |
|
Does anyone have experience doing continuous deployment from Bamboo to Azure?
|
# ? Jan 29, 2014 03:27 |
|
I have a pretty specific question that I'm hoping someone can help with. I'm using DevExpress ASP.NET components in MVC and I'm having some trouble getting a GridView to behave correctly. I can get the data loaded into the grid, and I can get the paging/sorting to work for the first click, but it then leaves me with a loading panel that won't go away. I've posted some more specific information and code examples here: http://stackoverflow.com/questions/21273148/devexpress-asp-net-mvc-gridview-callbacks-result-in-infinite-loading-animation I'm going a little nuts trying to figure this out. I get no Javascript errors, the information is clearly coming back okay because the GridView refreshes with the (for example) second page of data but it just won't quit with the loading panel. I've Googled the heck out of this and even though I've found a few instances of people having a similar problem, I can't find anything that fixes it for me. Edit: never mind, it was a really, really stupid error on my end putin is a cunt fucked around with this message at 06:21 on Jan 29, 2014 |
# ? Jan 29, 2014 03:57 |
|
Is migrating projects between different versions of Visual Studio generally safe? I work on a variety of projects and generally open them in whatever version they've been created with, but I have one older VB.NET project that's in VS 2008, which has been annoying me so I just opened it up in 2013. It seems to be building and running ok so far, but are there any pitfalls I should be aware of? It was the full version of VS 2008 and this is the express edition of 2013, and it's a WPF app, if any of those things make a difference. e: One thing I have noticed is that it's automatically switched the target platform from 3.5 to 4.0 without asking me. chippy fucked around with this message at 11:00 on Jan 30, 2014 |
# ? Jan 30, 2014 10:50 |
|
Depending on what you're doing, you may find that support for certain project types is discontinued between versions. I think this has been a bit more common with web related projects in the past. I don't primarily work in Visual Studio, so I don't have a lot of experience with it. I do know that we currently have setup projects in a 2010 solution and I believe they dropped support for those in 2012. It probably goes without saying, but you definitely want things in source control before you migrate. I think Visual Studio does produce a report of what was changed. However, I'd still want to look at diffs for things like the project files.
|
# ? Jan 30, 2014 12:33 |
|
Oh yeah, everything's in source control so there's no danger of my hosing it into some unrecoverable state, and I took a copy to migrate and see what happened anyway. The migration report shows only the project/solution files being changed, none of the source files seemed to be touched at all. Haven't diffed the files yet to see what actually changed. The only thing that seemed to break was a reference to System.Windows.Forms.DataVisualization, which seemed kind of strange, but I was able to just add the ref back in, maybe it was just a different version or something. Might have been something to do with going from .NET 3.5 to 4.0 I guess. I've carried on work in 2008 for now though as I've got poo poo to do, maybe I'll come back to it later.
|
# ? Jan 30, 2014 13:42 |
|
The biggest problem I've ran into is VS2012 no longer support Visual Studio Setup Projects (vdproj). You need to use WIX. You can browse this StackOverflow thread for more info about it. Besides that there's always minor breaking changes but I've never ran into one.
|
# ? Jan 30, 2014 15:31 |
|
gariig posted:The biggest problem I've ran into is VS2012 no longer support Visual Studio Setup Projects (vdproj). You need to use WIX. You can browse this StackOverflow thread for more info about it. Besides that there's always minor breaking changes but I've never ran into one. It also doesn't support old-style database projects (use SSDT instead!) or Web Deploy projects (use proper release management tools instead!).
|
# ? Jan 30, 2014 15:33 |
|
I'm not sure if this is a .NET problem or a Unity problem, but I have this xml data:XML code:
quote:InvalidOperationException: MapsetMapRowHex is not a collection
|
# ? Jan 30, 2014 15:35 |
|
What does the XSD and generated class look like?
|
# ? Jan 30, 2014 15:40 |
|
Wheany posted:I'm not sure if this is a .NET problem or a Unity problem, but I have this xml data: No idea about the xsd because I don't use that junk but the class to handle this is pretty easy -- trick is to us the [XmlElement] attribute on the array properties for the Maps under MapSet and the rows under the Map. I can work up a code example a bit later if that don't help.
|
# ? Jan 30, 2014 15:42 |
|
XSD:XML code:
C# code:
Edit: wwb posted:No idea about the xsd because I don't use that junk but the class to handle this is pretty easy -- trick is to us the [XmlElement] attribute on the array properties for the Maps under MapSet and the rows under the Map. I can work up a code example a bit later if that don't help. I'm going the "Arbitrary XML" -> code route, not the other way around. Wheany fucked around with this message at 15:48 on Jan 30, 2014 |
# ? Jan 30, 2014 15:46 |
|
Yup, that is usually where I start too. Write class, write unit test to deserailize, play attribute voodoo until it works. XSD is some old poo poo (like 2002, .NET 1.0 old). You need something like code:
|
# ? Jan 30, 2014 15:59 |
|
wwb posted:Yup, that is usually where I start too. Write class, write unit test to deserailize, play attribute voodoo until it works. Yeah, I guess generated code always looks messier than hand-written code. That seems to have done it after a couple of minor tweaks. Thanks. Although I'm still interested in why the hell the generated code didn't work.
|
# ? Jan 30, 2014 16:09 |
|
Just glancing at it the generator seemed to think your maprowhex was a 2 dimensional array for some reason. It wasn't the bestest thing in it's day once the xml got non-trivial.
|
# ? Jan 30, 2014 16:48 |
|
wwb posted:Just glancing at it the generator seemed to think your maprowhex was a 2 dimensional array for some reason. It wasn't the bestest thing in it's day once the xml got non-trivial. Okay, is there something similar that people actually use in 2014? I just followed the instructions here http://elegantcode.com/2010/08/07/dont-parse-that-xml/ after having had good experiences with JAXB on Java side.
|
# ? Jan 30, 2014 17:17 |
|
This is a little more generalized than a specific .NET question, but since I'm using it in a .NET app I'll ask here. Ok, let's say I have 3 List<Foo> that contain elements that could be common to all three, two, or none. I want to create a 4th list that combines all the elements of the 3, but orders them so that Foos that appear in all of them get put first, then 2, then the unique ones. (think kind of like a search engine?) What's the best approach to go about this?
|
# ? Jan 30, 2014 17:39 |
|
To be honest I fell into hand-wiring my deserialization back in 2003 or so and never looked back but I'm finnicky about having my objects look like I want them to look not like whatever they are sending down the wire and such.
|
# ? Jan 30, 2014 17:57 |
|
aBagorn posted:This is a little more generalized than a specific .NET question, but since I'm using it in a .NET app I'll ask here. e: I misunderstood the question and Ithaqua's answer is better. raminasi fucked around with this message at 19:23 on Jan 30, 2014 |
# ? Jan 30, 2014 18:41 |
|
GrumpyDoctor posted:Here's how I'd do it: I went with this: listOne.Concat(listTwo).Concat(listThree).GroupBy(l => l).Select(s => new { s.Key, Count = s.Count() }).OrderByDescending(o => o.Count);
|
# ? Jan 30, 2014 19:05 |
|
Wheany posted:Okay, is there something similar that people actually use in 2014? I just followed the instructions here http://elegantcode.com/2010/08/07/dont-parse-that-xml/ after having had good experiences with JAXB on Java side. DataContractSerializer
|
# ? Jan 30, 2014 19:59 |
|
Ithaqua posted:I went with this: Holy crap, that's pretty much what I need! I'll fiddle around with it and add a couple of .ThenByDescending() because I'll need to put items that are only in list 2 ahead of those only in list 1, etc etc. Awesome!
|
# ? Jan 30, 2014 20:51 |
|
I don't understand. Is there some tool that generates classes from arbitrary xml/schema using that? That's what I meant with my question.
|
# ? Jan 31, 2014 09:29 |
|
Yes, the newer tool is svcutil.exe. with the /dconly flag, it will generate classes from an xsd, hopefully with more success than xsd.exe had.
|
# ? Jan 31, 2014 10:05 |
|
Gul Banana posted:Yes, the newer tool is svcutil.exe. with the /dconly flag, it will generate classes from an xsd, hopefully with more success than xsd.exe had. Thank you. I feel like I'm doing C# the same way I was doing PHP in 2002, just google it and then click on the first link that goes to W3schools. "Hmm, mysql_query, eh?"
|
# ? Jan 31, 2014 10:13 |
|
I'm using Visual Studio for the first time in my life, Visual Studio Express 2012 for Windows Phone to be exact. I have this XAML:code:
What could I be doing wrong that would cause this behavior?
|
# ? Jan 31, 2014 15:22 |
|
VS2012 Express RTM? If so, install Update 4. I seem to recall some XAML issues got fixed between RTM and Update 4. Or better yet, just install VS2013.
|
# ? Jan 31, 2014 15:34 |
|
Ithaqua posted:VS2012 Express RTM? If so, install Update 4. I seem to recall some XAML issues got fixed between RTM and Update 4. Visual Studio Express 2012 for Windows Phone is the latest version "for Windows Phone" that they have for download on the Visual Studio page. I've never done any .NET work prior to this so I'd be concerned about jumping to 2013 if it doesn't have the Windows Phone functionality built in. edit - Apparently this might be due to having spaces in my project name or path to the project.. Ugh. I'll try making those adjustments. double edit - That did seem to resolve the issue. I had tried it before but didn't know to change the assembly name also. cletus42o fucked around with this message at 16:54 on Jan 31, 2014 |
# ? Jan 31, 2014 15:48 |
|
TFS 2013 with Git question, if this is better off in the Source Control thread I can move it. I'm hoping for feedback on a good way to manage our projects. We hope to use project management features of TFS like bug-tracking and such. We've got several different .NET solutions, and everyone has different ideas about how to organize this: 1) Single TFS project, single Git repo where each solution is in a different branch (really multiple branches per solution for development/production etc). Seems like switching between branches to get to a different solution would suck, because we couldn't work on more than one solution/branch without committing changes before the branch switch? Also seems to take a long time to switch between branches since it removes and adds a bunch of files each time. 2) Multiple TFS projects, one solution per project, one Git repo for that project, multiple branches to accommodate development/production etc. Will this make it harder to work with in-house libraries that are shared across solutions? 3) Single TFS project, multiple Git repos for the solutions? None of us are terribly familiar with TFS and Git, so I'm hoping someone in here can offer some good pros and cons, or to point out obviously good/bad ideas.
|
# ? Feb 1, 2014 00:19 |
|
|
# ? Jun 4, 2024 22:26 |
|
Opulent Ceremony posted:TFS 2013 with Git question, if this is better off in the Source Control thread I can move it. I'm hoping for feedback on a good way to manage our projects. We hope to use project management features of TFS like bug-tracking and such. First off, answer this question: Why do you want to use Git over standard TFVC? Git is generally a lot harder to use effectively. Full disclosure: I am massively biased against Git. Think of a team project as a "portfolio". If you have a bunch of interrelated applications, then they should all be in the same team project. You can subdivide them into more discrete units by using multiple teams and areas within your team project. If you have totally separate applications that share nothing, then you can split them into different team projects. You definitely don't want to store different different applications in different branches; that's not what branches are for. Branches are for isolating work in progress so that multiple developers can work on multiple things without potentially leaving your baseline source code in a broken state. My gut instinct would be to keep everything within the team project in a single repository, but the Git experts out there may disagree. The idea is to keep things that are interrelated and share pieces all together and in sync with one another. New Yorp New Yorp fucked around with this message at 01:12 on Feb 1, 2014 |
# ? Feb 1, 2014 01:08 |