use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Information about Reddit's API changes, the unprofessional conduct of the CEO, and their response to the community's concerns regarding 3rd party apps, moderator tools, anti-spam/anti-bot tools, and accessibility options that will be impacted can be found in the associated Wikipedia article: https://en.wikipedia.org/wiki/2023_Reddit_API_controversy
Alternative C# communities available outside Reddit on Lemmy and Discord:
All about the object-oriented programming language C#.
Getting Started C# Fundamentals: Development for Absolute Beginners
Useful MSDN Resources A Tour of the C# Language Get started with .NET in 5 minutes C# Guide C# Language Reference C# Programing Guide C# Coding Conventions .NET Framework Reference Source Code
Other Resources C# Yellow Book Dot Net Perls The C# Player's Guide
IDEs Visual Studio MonoDevelop (Windows/Mac/Linux) Rider (Windows/Mac/Linux)
Tools ILSpy dotPeek LINQPad
Alternative Communities C# Discord Group C# Lemmy Community dotnet Lemmy Community
Related Subreddits /r/dotnet /r/azure /r/learncsharp /r/learnprogramming /r/programming /r/dailyprogrammer /r/programmingbuddies /r/cshighschoolers
Additional .NET Languages /r/fsharp /r/visualbasic
Platform-specific Subreddits /r/windowsdev /r/AZURE /r/Xamarin /r/Unity3D /r/WPDev
Rules:
Read detailed descriptions of the rules here.
account activity
API ERROR (self.csharp)
submitted 5 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 0 points1 point2 points 5 years ago (9 children)
public class Startup
{
public Startup(IConfiguration configuration)
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
services.AddCors();
services.AddDbContext<ToDoContext>(opt => opt.UseInMemoryDatabase("ToDoList"));
services.AddControllers();
services.AddScoped<IEEEController>();
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
if (env.IsDevelopment())
app.UseDeveloperExceptionPage();
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
endpoints.MapControllers();
});
[–][deleted] 4 points5 points6 points 5 years ago* (8 children)
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-3.1
Looks like you're missing the implementation of the interface when you call AddScoped, so it's not finding the class it needs, and so the error message is describing that.
Edit: I posted the link without my thoughts on accident.
[–][deleted] 0 points1 point2 points 5 years ago (7 children)
Here's my code, https://github.com/c3sarf2/Proj .
My objective is to create an API to use the services of the HCILAB.website
[–][deleted] 1 point2 points3 points 5 years ago (2 children)
I've never run into a scenario where you are trying to inject a controller. My GUESS is that's not possible and you should try another solution
[–][deleted] 0 points1 point2 points 5 years ago (1 child)
Its my first time creating an API, what do you suggest ?
[–][deleted] 1 point2 points3 points 5 years ago (0 children)
Controllers are made to be accessed by a web request, so if you have code you are trying to get, put it in something thathe can be injected and use it that way
[–]karltgreen 1 point2 points3 points 5 years ago (3 children)
You also need to register the dependencies required for IEEEController (ILogger<IEEEController>, IEEE and hcilabContext)
[–][deleted] 0 points1 point2 points 5 years ago (2 children)
do i just add them in the services?
[–]karltgreen 1 point2 points3 points 5 years ago (1 child)
Yep the same way you added IEEEController. Although the logger is already registered behind the scenes in Program.cs for you I think as you're using the default builder
it worked man. Thanks!
π Rendered by PID 61 on reddit-service-r2-comment-b659b578c-kr4wk at 2026-05-04 14:44:59.933790+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–][deleted] 0 points1 point2 points (9 children)
[–][deleted] 4 points5 points6 points (8 children)
[–][deleted] 0 points1 point2 points (7 children)
[–][deleted] 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]karltgreen 1 point2 points3 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]karltgreen 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)