---
title: "Dependency Injection with the Lambda Annotations Library for .NET - Part 1, Lambda Applications"
url: https://daily.dev/posts/dependency-injection-with-the-lambda-annotations-library-for-net---part-1-lambda-applications-4ixjz6mim
source_url: https://nodogmablog.bryanhogan.net/2022/10/dependency-injection-with-the-lambda-annotations-library-for-net-part-1-lambda-applications
type: article
source: "No Dogma Blog (Bryan Hogan)"
published: 2026-05-31T07:47:11.695Z
updated: 2026-05-31T08:44:48.213Z
tags: [".net", "serverless", "aws-lambda", "dependency-injection"]
reading_time: 7
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Dependency Injection with the Lambda Annotations Library for .NET - Part 1, Lambda Applications

**[No Dogma Blog \(Bryan Hogan\)](https://daily.dev/sources/bryanhogan)** · 7 min read · 0 upvotes · 0 comments

## Summary

A step-by-step guide to using the Amazon.Lambda.Annotations library for dependency injection in .NET AWS Lambda applications deployed via `dotnet lambda deploy-serverless`. Covers the difference between scoped and singleton service lifetimes in the Lambda execution model, explaining why scoped services should be injected into the function handler method while singletons belong in the constructor. Includes complete code examples for both patterns with deployment and invocation commands.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nodogmablog.bryanhogan.net/2022/10/dependency-injection-with-the-lambda-annotations-library-for-net-part-1-lambda-applications>

---

Tags: [#.net](https://daily.dev/tags/.net), [#serverless](https://daily.dev/tags/serverless), [#aws-lambda](https://daily.dev/tags/aws-lambda), [#dependency-injection](https://daily.dev/tags/dependency-injection)

[View this post on daily.dev](https://daily.dev/posts/dependency-injection-with-the-lambda-annotations-library-for-net---part-1-lambda-applications-4ixjz6mim)
