C
C#big OOF

ā” QuestionController

Hello, i have a question regarding API structure. I have two classses, Item and Store. I created CRUD endpoints for both. Lets say i want to be able to return a store including all the items related to that store, and also be able to to POST a store with items. Would you create a seperate controller for these endpoints, for example StoreIemController containing PostStoreWithItems/GetAllStoresWithItems or use existing Store/ItemController? Thanks in advance šŸ™‚
D
Dustyā€¢383d ago
Wouldn't that be a good fit for nesting? Like GET /Store/{storeId}/Items Same for post
BO
big OOFā€¢383d ago
Souns like a good idea! I have a endpoint for bith Store and item, lets say i have a webpage that allows the user to add a new store and the stores items. Would you use two seperate calls(POST store and POST Item) or would you create anew POST-endpint? In that case it would be only one endpoint instead of two but i would have to seperate the POST-body to be able to insert it to the Store and Item table in the DB šŸ™‚
A
Accordā€¢382d ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
D
Dustyā€¢382d ago
Hmm it depends on how you structured your UI In general I'd stick to the REST pattern
A
Accordā€¢374d ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
ā” Problem Binding to Image SizeI am making an app that displays a series of books. An image and title of the book is to be displayeā” whats the best site or youtube channel to start learning c#?just downloaded visual studio and wanted to know what would be the best way to learn C#ā” C# MVC - Erroring in VSC not VS2022I'm writing a C# .Net Core 7.0 web application with dapper for my SQL queries. It runs just fine inString Contain issueSo im trying to get a word in a string using Contain but its not getting the word, I havent found a ā” Catching Exceptions with generic parameters?When adding an entity to the database, i first check if it already exists and if it does I throw an ā” How should I learn programming?I'm sure this is a common question, but I want to learn game development but am a pretty new C# progā” How to properly structure projects in a multi-app MVVM solution?I tend to structure my MVVM projects in the following way: ``` . ā”œā”€ā”€ src/ ā”‚ ā”œā”€ā”€ Applications/ ā”‚ Sending File and Data to a Minimal API endpointHi. I am using .NET 7, Minimal API and Mailkit. What I want to do is to send an attachment along wiā” reprotucing the kings pathcan anybody help me fix this code https://paste.mod.gg/sgsvrbaqnmpi/0 ``` the input is number of obsā” Its there a way to fix this?Hi there, currently I am trying to develop some functions to publish them to azure later, but right āœ… Does this styling code look right?I'm using this code for a simple hover effect. Im wondering if I'm doing this correctly: <Window.Reā” ?[] operator for dictionariesIs not working. It is explained here. https://learn.microsoft.com/en-us/dotnet/csharp/language-referā” IAsyncEnumerable vs List<T> as parameter in methodI have a method that is overloaded and will take in a List<T> or IAsyncEnumerable. The method will bā” This code is bugged how can i solve it?```LogiwaEntities1 db = new LogiwaEntities1(); ProductData productData = new ProductDataāœ… How to add hover effect to WPF button elementThis code I'm using isn't working. When I hover over buttons its a lightblue color. <Style with or without refso i learned that in c#(or most oop languages) when you create a method that takes an object as a paāœ… .net trying to find non-existent cs files`Error IDE1100 Error reading content of source file 'D:\Dev\C++\Test\TestCS\obj\Debug\net6.0\.ā” WPF - Binding to last child of collectionI have the following setup: ```csharp public partial class StatusMessageService : ObservableObject