|
I think, rather than exposing my API layer to arbitrary queries, I’m just going to expose the endpoints which I need, like to get all dishes in category Pizza: https://localhost:5001/v1/Dish/ForCategory/1 But thanks for the responses. I’ll definitely check them out.
|
# ? Aug 9, 2020 00:15 |
|
|
# ? Jun 1, 2024 16:58 |
|
Has anyone here had experience with the .NET implementation of gRPC? I just discovered this today and want to learn more. If anyone has a link or three to some reading/tutorials that aren't part of the MS documentation and actually show something somewhat complex with it that would be great.
|
# ? Aug 9, 2020 02:04 |
|
I've been on too many CRM projects where all code ended up in <EntityName>Manager classes, so much so that I can't even remember how to name and define responsibilities of new classes. Does anyone have any tips for getting me back on track, so I'll write less lovely code in the future?
|
# ? Aug 11, 2020 08:10 |
|
Embrace CQRS. It flattens everything.
|
# ? Aug 14, 2020 05:27 |
|
ModeSix posted:Has anyone here had experience with the .NET implementation of gRPC? Define Complex? GRPC.NET is pretty straightforward: a protobuf goes through codegen and stubs out the messages into request/reply types and virtual methods you can override in an implementation to do whatever you'd like within the boundaries of that signature. MSDN has some of the more thorough documentation on getting this all set up to run alongside ASP.NET Core, but Google's got some documentation on their equivalent stuff as well.
|
# ? Aug 14, 2020 13:26 |
|
OK so this is a new one on me. ASP MVC template weirdness: I've got a simple int property in a model that represents a DB ID that I want to round-trip through a form, so I docode:
code:
|
# ? Aug 14, 2020 21:02 |
|
Munkeymon posted:I'm stumped here and wondering if y'all have seem anything like this. Been a while since I played with cshtml, and maybe this is a stupid question but, is ThingamagigId a property (not a field)? What is the access modifier (public/private/protected)?
|
# ? Aug 14, 2020 21:10 |
|
epalm posted:Been a while since I played with cshtml, and maybe this is a stupid question but, is ThingamagigId a property (not a field)? What is the access modifier (public/private/protected)? It's a public property, yeah. And, like I said, it works right if the same partial view with the same model type is rendered from a different method, for some reason.
|
# ? Aug 15, 2020 08:36 |
|
I'm a bit rusty on asp.net, and may be mixing up various ms web tech, but try one of the hiddenfor overloads, something like code:
Alternatively, it working from one method and not the other could (perhaps) be caused because they're different http actions (ie GET vs POST) and/or whether its updating the pages viewbag/viewdata dictionary on page load vs form entry. depending on how its called, the model state may not be updated - in past projects, this was from "odd" JS calls on the page, which would ignore/null the controller model.... i think. its been a little bit. I also seem to remember just adding an attribute on the model Id property was enough with a similar issue, but i think that was an older serialization lib thing
|
# ? Aug 15, 2020 12:04 |
|
DI best practices question. Say I have a project already up and running that digests data in a database:code:
Currently I'm able to solve it by creating a "context" object that represents a single database, and update the services to have a dependency on that instead of referencing AppSettings directly. Then I create a scope in the ServiceProvider, and when looping through the databases, get a new context object and set the properties in that manually. It works, but it feels like there's a better way to go about doing this: code:
|
# ? Aug 17, 2020 15:16 |
|
bobthenameless posted:I'm a bit rusty on asp.net, and may be mixing up various ms web tech, but try one of the hiddenfor overloads, something like That does work, but it works by making a second attribute 'Value' that's actually filled in while the 'value' attribute is still blank. The form deserializer must build a value dict case-insensitively, so it round-trips correctly, Turns out the previous form is sending a blank ThingamagigId which is saved in ModelState and the HTML helpers prefer values from there over values in the actual Model for some reason, even when it's blank, which is the opposite of the form serializer's behavior Calling Clear() on ModelState fixes it but boy that's surprising, and not in a fun way.
|
# ? Aug 17, 2020 15:17 |
|
MisterZimbu posted:DI best practices question. Say I have a project already up and running that digests data in a database: Don't inject IAppSettings, but instead inject your own IConnectionStringProvider. Then, use the "for X class dependency Y, use implementation Z". The code for Lamar is approximately: code:
|
# ? Aug 18, 2020 03:37 |
|
Cuntpunch posted:Define Complex? I am looking for something a bit more in depth than a hello - response example, which is what I've been able to find digging through the Microsoft documentation/sample pieces on it. Or maybe it is that simple and I am over thinking it?
|
# ? Aug 18, 2020 03:43 |
|
ModeSix posted:I am looking for something a bit more in depth than a hello - response example, which is what I've been able to find digging through the Microsoft documentation/sample pieces on it. Possibly, but what is your use case? In the simplest sense, GRPC is just message-passing, regardless of how complicated those message structures might be. Define a protobuf schema, then implement the generated methods on the server side so that the generated Client can get that data back. For unary calls (hit an endpoint with a request, get a response) it's *just that simple* and with GRPC.NET, even streaming (what I might call 'complex' behavior) is really straightforward: https://docs.microsoft.com/en-us/aspnet/core/grpc/client?view=aspnetcore-3.1 You can hide as much complicated logic as you want in the server method implementations, but that's not part of the scope of GRPC.NET. Which is, basically, just 'for this RPC endpoint, given a defined Request message, I'll generate a defined Response message'.
|
# ? Aug 18, 2020 12:17 |
|
Anyone have positive or negative experiences with Math.NET? I need to rewrite someone else’s Matlab code. I have much more experience with .NET than python.
|
# ? Aug 24, 2020 17:31 |
|
Calidus posted:I need to rewrite someone else’s Matlab code. Haven't got any special tips, other than remember that someone loves you and that the world is a beautiful place.
|
# ? Aug 24, 2020 19:59 |
|
Calidus posted:Anyone have positive or negative experiences with Math.NET? I need to rewrite someone else’s Matlab code. I have much more experience with .NET than python. I'm not familiar with the details of its implementation (it has some support for MKL) but it's probably worth doing some research about performance and if you're going to be able to recreate whatever they've done in Matlab efficiently.
|
# ? Aug 24, 2020 21:51 |
|
Calidus posted:Anyone have positive or negative experiences with Math.NET? I need to rewrite someone else’s Matlab code. I have much more experience with .NET than python. I wasn't a fan the 19 minutes I played with it. It is probably a very authentic port, but it's not very .NET friendly. A lot of the method calls are static calls, and they update the parameters passed in, and that's gross to me.
|
# ? Aug 25, 2020 04:24 |
|
pointsofdata posted:I'm not familiar with the details of its implementation (it has some support for MKL) but it's probably worth doing some research about performance and if you're going to be able to recreate whatever they've done in Matlab efficiently. insta posted:I wasn't a fan the 19 minutes I played with it. It is probably a very authentic port, but it's not very .NET friendly. A lot of the method calls are static calls, and they update the parameters passed in, and that's gross to me. I touched it once like a decade ago and I remember it being a pain to wire it up to properly use the underlying FORTRAN libraries that it wanted to delegate to, which is a bad sign for usability and a good sign for performance. But again, this was a decade ago.
|
# ? Aug 26, 2020 00:12 |
|
Has anyone synchronized MachineKeys on Azure by copying the sections from one App Service's rootweb.config to another manually through Kudu tools? Or even heard of this being done? In case you're tempted to X/Y me here: Yes, I know App Service Plans share keys but they're location-bound and we failover between locations. Yes, I know you can set them during Application_Start, but that's code that needs maintained.
|
# ? Aug 27, 2020 15:19 |
|
Munkeymon posted:Has anyone synchronized MachineKeys on Azure by copying the sections from one App Service's rootweb.config to another manually through Kudu tools? Or even heard of this being done? Can't you store them in keyvault and have the application pull them from keyvault at startup?
|
# ? Aug 27, 2020 15:21 |
|
New Yorp New Yorp posted:Can't you store them in keyvault and have the application pull them from keyvault at startup? Munkeymon posted:Yes, I know you can set them during Application_Start, but that's code that needs maintained.
|
# ? Aug 27, 2020 16:22 |
|
Munkeymon posted:Has anyone synchronized MachineKeys on Azure by copying the sections from one App Service's rootweb.config to another manually through Kudu tools? Or even heard of this being done? I assume you're not using Core? The DataProtection stuff in Core should work seamlessly for App Services. The key files are backed to network storage and automatically synced to all machines.
|
# ? Aug 27, 2020 18:00 |
|
B-Nasty posted:I assume you're not using Core? The DataProtection stuff in Core should work seamlessly for App Services. The key files are backed to network storage and automatically synced to all machines. I did see that but assumed we couldn't share a filesystem mounted to App Services between regions. Also, we're not on Core, but the package claims to work with 4.5.1 and up. Munkeymon fucked around with this message at 19:19 on Aug 27, 2020 |
# ? Aug 27, 2020 19:17 |
|
I guess this is more of a SQL question than a .NET question, but... I have a versioned table in my MVC project with 2 columns defined like so:code:
|
# ? Sep 1, 2020 13:24 |
|
The example in the docs doesn't have NOT NULL on the time columns, so that might be messing up whatever mechanism automatically sets and updates the start/end time.
|
# ? Sep 1, 2020 17:04 |
|
the start and end times for temporal tables define the period for which that row is valid. sql uses the maximum possible time for a row to indicate that the row is currently active. end will only be set to a different value when the row is deleted, which indicates the row is closed and no longer active. see the docs
|
# ? Sep 1, 2020 23:21 |
|
redleader posted:the start and end times for temporal tables define the period for which that row is valid. sql uses the maximum possible time for a row to indicate that the row is currently active. end will only be set to a different value when the row is deleted, which indicates the row is closed and no longer active. see the docs Hmm, I assumed they meant there were overlapping records with that end date, but now I'm not sure why I assumed that
|
# ? Sep 2, 2020 15:53 |
|
Munkeymon posted:Hmm, I assumed they meant there were overlapping records with that end date, but now I'm not sure why I assumed that For the same primary key value, there should be no overlap.
|
# ? Sep 2, 2020 16:05 |
|
pointsofdata posted:For the same primary key value, there should be no overlap. Right, which is why I jumped to assuming they did something that prevented SQL from managing the column values correctly.
|
# ? Sep 2, 2020 20:12 |
|
Is there a way in visual studio to show unused public properties, without using resharper?
|
# ? Sep 4, 2020 22:39 |
|
Withnail posted:Is there a way in visual studio to show unused public properties, without using resharper? Make it private and see what breaks.
|
# ? Sep 5, 2020 01:12 |
|
New Yorp New Yorp posted:Make it private and see what breaks. lol I need to refactor hundreds of legacy classes. That would not be time efficient.
|
# ? Sep 5, 2020 01:17 |
|
Withnail posted:lol I need to refactor hundreds of legacy classes. That would not be time efficient. Sounds like you need Roslyn!
|
# ? Sep 5, 2020 03:04 |
|
Withnail posted:Is there a way in visual studio to show unused public properties, without using resharper? The problem is that it's not necessarily safe to make that suggestion, since it presents a significant breaking change to (primarily) library authors.
|
# ? Sep 5, 2020 06:19 |
|
Just decided to resume work on a personal project after a month away from it, Visual Studio asks to update itself and I say yes... and now I have a bunch of uh, whatever this is:code:
Microsoft's docs on NU1202 say "Solution: Change the project's target framework to one that the package supports." but um... the error messages say the packages don't support any target framework. so how would I do that?! e: and I did a clean and rebuild, deleted the bin and obj folders for all projects in the solution, restarted even though the VS installer didn't ask me to, this still happens. e: also tried code:
Hammerite fucked around with this message at 21:02 on Sep 6, 2020 |
# ? Sep 6, 2020 20:36 |
|
Well, it turns out there were minor-minor updates to the 4 nuget packages I actually had references to (they went from 3.2.0 to 3.2.1) and installing those solved the problem. VS's nuget interface refused to update them though, I had to uninstall the packages and then reinstall them. super unhelpful behaviour from VS - if it had just said "you must update these packages because we hosed around with something" obviously I would have done.
|
# ? Sep 6, 2020 21:12 |
|
My csproj files has a <Compile Include"..."/> entry for each cs-file in the project, and it's giving me merge errors every time someone else added a file. Is that the normal way, or can I tell it to include everything, and exclude specifics if I want? EDIT: It looks like it works with this tag. Is this the "proper" way to do it? code:
Boz0r fucked around with this message at 08:04 on Sep 7, 2020 |
# ? Sep 7, 2020 07:50 |
|
Boz0r posted:My csproj files has a <Compile Include"..."/> entry for each cs-file in the project, and it's giving me merge errors every time someone else added a file. Is that the normal way, or can I tell it to include everything, and exclude specifics if I want? The “proper” way is to update to SDK-style project files, which implicitly include all .cs files in the project directory. I’m on my phone or I’d find more specific instructions.
|
# ? Sep 7, 2020 19:35 |
|
|
# ? Jun 1, 2024 16:58 |
|
Withnail posted:Is there a way in visual studio to show unused public properties, without using resharper? CodeLense does it
|
# ? Sep 8, 2020 17:22 |