title: Blazor Component Logic or UI
body: <p>Im working with Blazor Wasm, and I'm new to the concept of components, I have seen the benefits of it such as UI elements, there are services like Mudblazor where you can use cards, tabs, etc. and I've used my own customer components for UI also.</p>
  <p>However, I'm a bit confused if its good or meant to be used for repeating logic.</p>
  <p>The site is to find an appointment, and this requires a few bits of information which will be the same each time I call it, so this same logic is used in 4 different locations so far, and I can see it being used in more, but each implementation of it is duplicating code, it has the same UI layout each time, it needs the same fields each time, and will return the same result type each time.</p>
  <p>The current pattern of the system after the UI is to duplicate code, for example if in one area of the website does the same as another area, it will call different database calls to keep all the code separate</p>
  <p>e.g</p>
  <p>Location 1 of website:
  Get Visits for this customer</p>
  <p>Passes in CustomerID
  It will go into Location 1 service -&gt; to Location 1 API Controller  -&gt; Location 1 CQRS and will return XYZ in a result.</p>
  <p>Location 2 of website:
  Get Visits for this customer</p>
  <p>Passes in CustomerID
  It will go into Location 2 service -&gt; Location 2 API Controller -&gt; Location2 CQRS and will return XYZ in a result.</p>
  <p>There are a few exemptions to this such as if its a very small and single use that wont ever change.</p>
  <p>And the reason its been done like this is if just 1 area has to change, you only have to change Location 1 area, and it wont affect Location 2.</p>
  <p>Thanks</p>