|
Mr Shiny Pants posted:You just have the file in your app directory, I wonder how they would lock that down. uncurable mlady posted:uh what? I should be more specific. I was deploying via Elastic Beanstalk, which does two things: Blows away your instance when you deploy, and there's access issues when using an image from elastic beanstalk. Here's someone on SO complaining about it: https://stackoverflow.com/questions/49954268/elastic-beanstalk-does-not-work-with-sqlite You can absolutely remote into your ec2 instance and fix the permission issues. But that doesn't help, because deploying wipes away your changes. It sucks and is bad, vs spinning up a DB on AWS itself. side note - I have pulled down over 10 repositories on GitHub that say they are ready to deploy dockerized .NET applications with an angular front end. Current number of successful deployments with no modifications: 0 -- who the gently caress likes docker here? I must be doing something wrong. User0015 fucked around with this message at 17:46 on Jan 9, 2019 |
# ? Jan 9, 2019 17:44 |
|
|
# ? Jun 8, 2024 07:54 |
|
For that kind of a scenario you need a database server. No ifs nor buts. Has nothing to do with sqlite itself. MySQL locally on the instance won't work either. It has to be a separate instance to which you connect remotely. If you're hell bent on sqlite you can work around the lack of server for it by having an instance in AWS that doesn't change/move/redeploy and which exposes a NFS folder that is then mounted by the EB managed instances. That's insane though. Really ... just use RDS and don't worry about it. Or use sqlite in an EC2 instance but not managed by anyone and anything. No scaling, no nothing.
|
# ? Jan 9, 2019 18:59 |
|
User0015 posted:who the gently caress likes docker here? I must be doing something wrong. Like most code in the world, most Docker images are poo poo. It is great when it is used well but it is no magic wand. Even some respectable 26000-star GitHub projects can have royally hosed up Docker images, as I have found out. If you are doing anything wrong, it is expecting stuff to work out of the box
|
# ? Jan 9, 2019 20:43 |
|
EssOEss posted:If you are doing anything wrong, it is expecting stuff to work out of the box Hah! True though. Also, total time to deploy an app by hand, literally setting up an empty Ubuntu server from scratch? ~1 hour. The bigger question is, is there any way to tell Visaul Studio to SFTP deploy into a box, then stop and restart automatically, after a publish? If I can get that working, gently caress all this docker deployment nonsense.
|
# ? Jan 9, 2019 21:29 |
|
Soooooo I do Windows database application development using ancient technology that I’m not even going to mention. I started finally learning C# and I’ve been doing a lot of reading about the kind of stuff I should be doing like using WPF, MVVM, and Entity Framework but since I’m kind of a noob I’m having trouble figuring out how to tie all this stuff together. Does anyone have any suggestions for resources, tutorials, courses, etc. that might be helpful? Most of the stuff I’ve found on Udemy is WinForms poo poo which I’d rather not deal with. Thanks y’all
|
# ? Jan 10, 2019 00:04 |
|
Pablo Nergigante posted:Soooooo I do Windows database application development using ancient technology that I’m not even going to mention. I started finally learning C# and I’ve been doing a lot of reading about the kind of stuff I should be doing like using WPF, MVVM, and Entity Framework but since I’m kind of a noob I’m having trouble figuring out how to tie all this stuff together. Does anyone have any suggestions for resources, tutorials, courses, etc. that might be helpful? Most of the stuff I’ve found on Udemy is WinForms poo poo which I’d rather not deal with. Thanks y’all Is it foxpro?! I hope it's not. You should look for Josh Smith's stuff on WPF and MVVM. That's a great starting point. I've also posted numerous times about both in this thread.
|
# ? Jan 10, 2019 01:13 |
|
Pablo Nergigante posted:Soooooo I do Windows database application development using ancient technology that I’m not even going to mention. I started finally learning C# and I’ve been doing a lot of reading about the kind of stuff I should be doing like using WPF, MVVM, and Entity Framework but since I’m kind of a noob I’m having trouble figuring out how to tie all this stuff together. Does anyone have any suggestions for resources, tutorials, courses, etc. that might be helpful? Most of the stuff I’ve found on Udemy is WinForms poo poo which I’d rather not deal with. Thanks y’all When I was learning WPF and C#, I found these books helpful: WPF 4.5 Unleashed and C# 7.0 in a Nutshell (although I have the 6.0 version). The former is a guide; the latter a (comprehensive, 1100+ page) reference. For MVVM, I didn’t get it until I really understood data binding, then it just clicked, so I don’t have a good book for that, but this looks like it might do the trick. As for EF, I’m going to punt on that one. The only books I was able to find were very outdated, not using the newer data context thingies so they were pretty useless except for basic concepts. I, personally, abandoned EF after struggling with it for six months and went back to my ADO Data Access Layer classes. But then, I have that luxury - I’m not a developer, I’m a firewall engineer writing tools for me and my team to use.
|
# ? Jan 10, 2019 01:24 |
|
GoodCleanFun posted:Is it foxpro?! I hope it's not. LongSack posted:When I was learning WPF and C#, I found these books helpful: WPF 4.5 Unleashed and C# 7.0 in a Nutshell (although I have the 6.0 version). The former is a guide; the latter a (comprehensive, 1100+ page) reference. For MVVM, I didn’t get it until I really understood data binding, then it just clicked, so I don’t have a good book for that, but this looks like it might do the trick. Awesome, thanks for the suggestions. I found a few other articles and YouTube videos so hopefully that will give me a decent starting point. And it’s not as ancient as FoxPro but not much better tbh
|
# ? Jan 10, 2019 01:50 |
|
Pablo Nergigante posted:Soooooo I do Windows database application development using ancient technology that I’m not even going to mention. I started finally learning C# and I’ve been doing a lot of reading about the kind of stuff I should be doing like using WPF, MVVM, and Entity Framework but since I’m kind of a noob I’m having trouble figuring out how to tie all this stuff together. Does anyone have any suggestions for resources, tutorials, courses, etc. that might be helpful? Most of the stuff I’ve found on Udemy is WinForms poo poo which I’d rather not deal with. Thanks y’all Wow, you sound like me a couple months ago. Someone in this thread at the time suggested Pro C# 7 which I found quite helpful. In addition to the language, it goes over ADO, EF, WPF, and MVVM. It is not a reference so it will cover some topics in more detail than others, but overall I found it to be a good introduction.
|
# ? Jan 10, 2019 06:18 |
|
qsvui posted:Wow, you sound like me a couple months ago. Someone in this thread at the time suggested Pro C# 7 which I found quite helpful. In addition to the language, it goes over ADO, EF, WPF, and MVVM. It is not a reference so it will cover some topics in more detail than others, but overall I found it to be a good introduction. Wow that looks fantastic. Thanks!
|
# ? Jan 10, 2019 06:32 |
|
Pablo Nergigante posted:Wow that looks fantastic. Thanks! Also, try not to jump into too many new concepts all at once, it's going to make you hit constant walls and be frustrated.
|
# ? Jan 10, 2019 15:47 |
|
New Yorp New Yorp posted:Also, try not to jump into too many new concepts all at once, it's going to make you hit constant walls and be frustrated. Yeah there's no immediate urgency so I'm starting with the basics and I'll work my way up from there. I haven't learned anything new programming wise in god knows how long
|
# ? Jan 10, 2019 16:04 |
|
I am trying to expose an API that allows data to be queried in a reasonably freeform fashion from a browser. An OData endpoint would be absolutely perfect. Unfortunately, the Microsoft OData library appears to be of dogshit quality and even basic things such as setting "show me the object metadata" start throwing exceptions deep inside the OData library. Not to mention a lovely API and a library design that is visibly burdered by legacy compatibility and half-baked features that were partially cut before every release. An alternative I considered was GraphQL but it seems too new and risky to take up - I am not convinced that mature .NET libraries exist for it at present. Everything I see on GitHub seems experimental. Plus its non-REST nature will be a turn-off and major learning experience. Is there a third alternative that I should consider here?
|
# ? Jan 16, 2019 06:52 |
|
EssOEss posted:I am trying to expose an API that allows data to be queried in a reasonably freeform fashion from a browser. An OData endpoint would be absolutely perfect. Take a look at tef's post about REST api's in the other thread about how to structure your API? tef posted:Here's a long post that tries to explain what the hell is REST, anyway. I like this one: https://vimeo.com/20781278 Mr Shiny Pants fucked around with this message at 07:25 on Jan 16, 2019 |
# ? Jan 16, 2019 07:21 |
|
I was thinking more of something that already exists that I can just throw a data model at, rather than manually implementing an API. That's a cool post, though!
|
# ? Jan 16, 2019 07:46 |
|
https://swagger.io/ maybe? Kinda busy atm, so maybe I didn't understand what you need exactly, but maybe it fits your need. Never used it myself.
|
# ? Jan 16, 2019 15:38 |
|
So help me to make sure I understand things, please. What I get from what I read about xxx Core is that it is designed to be used in libraries, with the GUI stuff separate. So, my app would have a common .NET core library (or libraries) with common code, EF core for database access, while the UI specific stuff (Windows vs iOS vs Android) floats “above” the core stuff. Is that about right?
|
# ? Jan 17, 2019 07:15 |
|
If you want to split it up, your common library can target some version of .NET Standard and then just consume it as normal from all your other apps. Check out the compatibility table on this page. So if you target .NET Standard 2, you can consume it with Xamarin iOS, Android and a Windows form app with versions 10.14, 8.0, and .NET Framework > 4.6.1 respectively. There are links in that link above that show you how to target .NET Standard from .NET Core tooling if that is what you would like to do. e: Versions stated were just an example, just find the lowest version out of all your front ends and target that version of .NET Standard. Xik fucked around with this message at 07:58 on Jan 17, 2019 |
# ? Jan 17, 2019 07:56 |
|
And please note that 4.6.1 can't actually be properly mixed with Standard 2.0. It works, kind of, but it's buggy as hell, see the Github or this thread a couple of pages back.
|
# ? Jan 17, 2019 10:35 |
|
Yeah, if you want to use a .NET Standard 2.0 library on Windows, your application should require the .NET Framework 4.7.2 for best compatibility. Note that this is only an issue if the library is pure .NET Standard. If you look at the Dependencies list in e.g. JSON.NET, which is an extremely compatible library you'll see that it multi-targets two different levels of .NET Standard and four versions of the .NET Framework, so if you use it from a .NET Framework application it will be able to just use the ".NETFramework 4.5" .dlls and completely ignore the .NET Standard ones.
|
# ? Jan 17, 2019 10:54 |
|
How do y'all solve the problem of setting the Owner property on modal dialogs in WPF, while using IoC and MVVM patterns? I've seen (and written) all sorts of hacks. Here's a naive example of a window with a viewmodel containing an ICommand which prompts the user. It works by setting vm.Owner = this, and then using Owner later in a MessageBox when the command is called. C# code:
Here's an example that abstracts the dialog into a Func, which is set in the constructor of the Window. C# code:
C# code:
There are other solutions like passing in (or service-locating) an IMessageBoxService, but I don't fully understand how you can specify the owner of a dialog without the ViewModel knowing who owns it. What do you do?
|
# ? Jan 17, 2019 23:48 |
|
epalm posted:How do y'all solve the problem of setting the Owner property on modal dialogs in WPF For my “tier 2” dialogs (i.e, those that appear above the “main window”), I use Application.Current.Mainwindow. For dialogs that are tier 3 (which for me are rare, and I can’t think of an instance where I went deeper), I don’t set it at all - I’ve not found a good solution to that, either. I just set the dialog to appear in the center of the screen. I’d be interested in a good solution to this as well.
|
# ? Jan 18, 2019 00:58 |
|
I took this as a starting point: https://www.codeproject.com/Articles/36745/Showing-Dialogs-When-Using-the-MVVM-Pattern?fid=1541292&fr=1#xx0xx. Made some adjustments and I have it on my view model base class for use in all view models. Allows me to open new windows, show messages, or ask yes/no questions directly from any view model.
|
# ? Jan 18, 2019 05:09 |
|
Question about design. Every example of EF that I’ve seen uses simple POCO classes with get/set auto properties. Yet, my views require observable classes. So, how do you handle this? Do you make your model classes observable? Do you create an intermediate observable class that “fronts” the model classes (even if there is a 1:1 relationship between the properties)? My response has been the former, but I’m curious — what do others do?
|
# ? Jan 18, 2019 06:20 |
|
epalm posted:How do y'all solve the problem of setting the Owner property on modal dialogs in WPF, while using IoC and MVVM patterns? I've seen (and written) all sorts of hacks. I am pretty sure I've used code similar to your callback example to do this kind of thing. I went looking for an example in the code for an app I was working on a few months ago (now being maintained by another team), but my recollection of where to find it didn't hold up.
|
# ? Jan 18, 2019 10:25 |
|
LongSack posted:Question about design. I don't really like the idea that a database entity class might have to change purely because of how I'm choosing to display that data, or that my display code would have to change if I reworked the data storage implementation. I'm pretty sure this scenario is exactly what AutoMapper was created for - you can have two separate objects that use the same data for different purposes without having to write loads of code to translate one to the other. Automapper Docs posted:Why use AutoMapper? Scikar fucked around with this message at 12:03 on Jan 18, 2019 |
# ? Jan 18, 2019 11:57 |
|
LongSack posted:Question about design. Just by coincidence after reading your question above a I stumbled across this Q/A on softwareengineering.stackexchange.com, the first answer of which details a bunch of scenarios of how to deal with changes with/without the "intermediate" objects you mentioned (they're often called DTOs or Data Transfer Objects). In my own experience, "weird things" happen when using EF entities in your UI rather than purpose-built DTOs. Those weird things include e.g. your objects becoming "dynamic proxies" which has something to do with lazy loading, so the object is kinda there, but not really, unless you access it, but when does/should that happen(?), etc. EF applies some magic to your so called POCOs, and your UI sometimes breaks because of that (WPF bindings do, at least). (Edit: here's an example of said weirdness.) Pull your entity out of the DB, use something like Automapper (mentioned above) to map the DB entities to DTOs, and then use those DTOs in your UI (or send them across the network, etc). Then on the way back (e.g. updating a record), pull the entity out of the DB, map the DTO on top of the entity, which kicks off EF's change tracking, etc. epswing fucked around with this message at 20:46 on Jan 18, 2019 |
# ? Jan 18, 2019 16:42 |
|
Thanks, both. I wasn't aware of automapper, I'll take a look at it.
|
# ? Jan 18, 2019 18:03 |
|
I hate that most MVC tutorials teach you to just use the data layer objects in the UI when you really want to avoid that in any non-trivial project.
|
# ? Jan 18, 2019 21:31 |
|
epalm posted:In my own experience, "weird things" happen when using EF entities in your UI rather than purpose-built DTOs. Those weird things include e.g. your objects becoming "dynamic proxies" Yeah this is basically the framework already dictating how your domain objects are constructed in terms of the database storage implementation side of things. The gist of it is that when you get your Customer from the DB, you may or may not want all of its properties to be retrieved as well (everything that has a foreign key to another table). So EF "helpfully" just gives you your Customer, but puts it behind a DynamicProxy so that if you do decide to access those properties further down the line, it can go back to the DB and get them as needed without you having to update the DB access code. If I understand right it's got some uses in prototyping or when the storage, application and UI are all local, but if you forget to turn it off in a web app and you're not careful you end up in a situation where expanding something in your UI triggers bunch of recursive queries to your DB and things start to fall over. If memory serves lazy loading is enabled by default in EF6, but in EF Core I think you have to include an extra NuGet package before you can even turn it on.
|
# ? Jan 19, 2019 02:32 |
|
Scikar posted:Yeah this is basically the framework already dictating how your domain objects are constructed in terms of the database storage implementation side of things. The gist of it is that when you get your Customer from the DB, you may or may not want all of its properties to be retrieved as well (everything that has a foreign key to another table). So EF "helpfully" just gives you your Customer, but puts it behind a DynamicProxy so that if you do decide to access those properties further down the line, it can go back to the DB and get them as needed without you having to update the DB access code. If I understand right it's got some uses in prototyping or when the storage, application and UI are all local, but if you forget to turn it off in a web app and you're not careful you end up in a situation where expanding something in your UI triggers bunch of recursive queries to your DB and things start to fall over. This was the source of my biggest frustration with EF 6.x, and it was basically due to my misunderstanding of how it all worked. When I failed to use all the .Include methods, so that later my value converters would throw exceptions because the context had already been disposed. I’m trying to give EF a second chance, esp since now with EF Core, there are books that are written against the current state of EF. Hopefully, this will help me understand EF so that I can use it. I love being able to use LINQ.
|
# ? Jan 19, 2019 03:56 |
|
Today I learned that when the manual says that "A static constructor is called automatically to initialize the class before the first instance is created or any static members are referenced." that does not apply to the static constructors of types derived from the class containing the aforementioned static member, even if it's a template/generic class.
|
# ? Jan 21, 2019 22:26 |
|
Munkeymon posted:Today I learned that when the manual says that "A static constructor is called automatically to initialize the class before the first instance is created or any static members are referenced." that does not apply to the static constructors of types derived from the class containing the aforementioned static member, even if it's a template/generic class. So let me see if I understand - you're saying code:
Hammerite fucked around with this message at 11:03 on Jan 22, 2019 |
# ? Jan 21, 2019 23:04 |
|
Munkeymon posted:Today I learned that when the manual says that "A static constructor is called automatically to initialize the class before the first instance is created or any static members are referenced." that does not apply to the static constructors of types derived from the class containing the aforementioned static member, even if it's a template/generic class. Let's pretend for a moment that it did: code:
Now pretend that I'm also a jerk and declared a bunch of types in my malicious assembly that allocate a 1GB array when constructed.
|
# ? Jan 22, 2019 00:54 |
|
Hammerite posted:So let me see if I understand - you're saying Look at this huge idiot who didn't make C2 inherit from C1. I fixed it and the same behaviour is observed - and the same behaviour is observed even if Main() refers to x as "C2.x", which I can understand being a little surprising. But presumably the C# compiler transforms it into a reference to C1.x, since C1 is where it's actually defined and it's all known about at compile time, so not that surprising?
|
# ? Jan 22, 2019 11:02 |
|
Night Shade posted:Let's pretend for a moment that it did: No, it's like this: C# code:
quote:Now pretend that I'm also a jerk and declared a bunch of types in my malicious assembly that allocate a 1GB array when constructed. I'm pretending I decompiled your poo poo and saw that before I used it because I'm required to for compliance in my current job Munkeymon fucked around with this message at 15:33 on Jan 22, 2019 |
# ? Jan 22, 2019 15:30 |
|
Munkeymon posted:No, it's like this: This is basically the example I gave, but dressed up with some unnecessary and distracting extra elements (the base class is generic and abstract). GetById() is defined on the base class, so when you access it (irrespective of the fact that you're referring to it as Ya.GetById()), the base class static constructor runs. You're not accessing anything that's actually part of Ya in that line.
|
# ? Jan 22, 2019 15:51 |
|
Also, you say that Basic<T> "conceptually doesn't exist on its own terms". I wouldn't presume to tell you how you ought to conceptualise things, but to say that Basic<T> doesn't exist on its own terms isn't true in .NET. It would be true of a template class in C++, say.
|
# ? Jan 22, 2019 15:54 |
|
Hammerite posted:Also, you say that Basic<T> "conceptually doesn't exist on its own terms". I wouldn't presume to tell you how you ought to conceptualise things, but to say that Basic<T> doesn't exist on its own terms isn't true in .NET. It would be true of a template class in C++, say. I mean that it exists as an instance in terms of something else. Namely, whatever the type parameter is. I couldn't figure out what the 'final form' of your example was supposed to be but the inheritance is the point. It's surprising that only part of the inheritance hierarchy was initialized, but becomes less so when you find out that, since 4.0 (the framework, not the compiler), statics are so aggressively lazily initialized that it will avoid initializing the value of a static property as long as it can. Additionally, just defining a static constructor can change the way initialization happens. Anywho, you can Make It Go by adding System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(T).TypeHandle); to the static constructor of the base class. e: because it's possible I described something wrong above but am too lazy to copy edit it for details, some further reading: http://csharpindepth.com/Articles/General/Beforefieldinit.aspx Munkeymon fucked around with this message at 21:38 on Jan 22, 2019 |
# ? Jan 22, 2019 20:47 |
|
|
# ? Jun 8, 2024 07:54 |
|
Oh wow, that really is surprising. I had better go review some of my code! Thanks for posting this!
|
# ? Jan 22, 2019 20:58 |