{"id":15035726,"url":"https://github.com/postsharp/postsharp.samples","last_synced_at":"2025-08-20T12:30:51.550Z","repository":{"id":38361617,"uuid":"52793471","full_name":"postsharp/PostSharp.Samples","owner":"postsharp","description":"PostSharp Samples","archived":false,"fork":false,"pushed_at":"2024-03-26T10:04:06.000Z","size":5167,"stargazers_count":120,"open_issues_count":5,"forks_count":58,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-12-07T13:32:16.647Z","etag":null,"topics":["aop","aop-architecture","aop-aspects","aop-framework","aspect-oriented-framework","aspect-oriented-programming","aspects","csharp","csharp-code","diagnostics","dotnet","postsharp"],"latest_commit_sha":null,"homepage":"https://samples.postsharp.net/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/postsharp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-29T13:36:53.000Z","updated_at":"2024-09-18T07:19:28.000Z","dependencies_parsed_at":"2023-01-25T02:30:45.432Z","dependency_job_id":null,"html_url":"https://github.com/postsharp/PostSharp.Samples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postsharp%2FPostSharp.Samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postsharp%2FPostSharp.Samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postsharp%2FPostSharp.Samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postsharp%2FPostSharp.Samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postsharp","download_url":"https://codeload.github.com/postsharp/PostSharp.Samples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230423559,"owners_count":18223435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aop","aop-architecture","aop-aspects","aop-framework","aspect-oriented-framework","aspect-oriented-programming","aspects","csharp","csharp-code","diagnostics","dotnet","postsharp"],"created_at":"2024-09-24T20:29:19.140Z","updated_at":"2024-12-19T11:11:14.092Z","avatar_url":"https://github.com/postsharp.png","language":"C#","readme":"# PostSharp.Samples\n\nWelcome to this collection of PostSharp example projects.\n\nYou can [browse these samples online](https://samples.postsharp.net/) and navigate the code just by clicking on code references, \nor you can download them on [GitHub](https://www.github.com/postsharp/PostSharp.Samples).\n\n\n| Project                                                                                                      | Description                                                                                  |\n| :----------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- |\n| **Aspect Framework**                 \n| [PostSharp.Samples.CustomLogging](Framework/PostSharp.Samples.CustomLogging/)                       | Logs method calls including parameter values.                                                |\n| [PostSharp.Samples.CustomCaching](Framework/PostSharp.Samples.CustomCaching/)                       | Caches the results of methods calls                                                          |\n| [PostSharp.Samples.ExceptionHandling](Framework/PostSharp.Samples.ExceptionHandling/)               | Add parameter values to call stack in exception details. Report and then swallow exceptions in entry points.  |\n| [PostSharp.Samples.AutoRetry](Framework/PostSharp.Samples.AutoRetry/)                               | Automatically retries a method call when it fails.                                           | \n| [PostSharp.Samples.WeakEvent](Framework/PostSharp.Samples.WeakEvent/)                               | Prevents memory leaks due to events.                                                         | \n| [PostSharp.Samples.ValidateResourceString](Framework/PostSharp.Samples.ValidateResourceString/)     | Prints a build-time warning when incorrect resource string name is passed to parameter.      | \n| [PostSharp.Samples.SessionState](Framework/PostSharp.Samples.SessionState/)                         | Stores a field or property in the session state or page view state.                          | \n| [PostSharp.Samples.Transactions](Framework/PostSharp.Samples.Transactions/)                         | Automatically executes a method inside a transaction.                                        | \n| [PostSharp.Samples.Profiling](Framework/PostSharp.Samples.Profiling/)                               | Measure different execution times of methods, including async methods.                       | \n| [PostSharp.Samples.Encryption](Framework/PostSharp.Samples.Encryption/)                             | Automatically encrypts and decrypts parameter and fields/properties                          | \n| [PostSharp.Samples.MiniProfiler](Framework/PostSharp.Samples.MiniProfiler/)                         | Measures method execution time with MiniProfiler of StackExchange.                           | \n| [PostSharp.Samples.Persistence](Framework/PostSharp.Samples.Persistence/)                           | Persists fields or properties into the Windows registry or `app.config`.                     | \n| [PostSharp.Samples.AutoDataContract](Framework/PostSharp.Samples.AutoDataContract/)                 | Automatically adds `[DataContract]` and `[DataMember]` attributes to derived classes and all properties | \n| [PostSharp.Samples.Authorization](Framework/PostSharp.Samples.Authorization/)                       | Requires permissions before getting or setting fields or executing methods.                  | \n| [PostSharp.Samples.NormalizeString](Framework/PostSharp.Samples.NormalizeString/)                   | Trims and lowercases strings before they are assigned to a field or property.\n| [PostSharp.Samples.StoredProcedure](Framework/PostSharp.Samples.StoredProcedure/)                   | Implements something like P-Invoke, but for database stored procedures.  |\n| **Diagnostics**                 \n| [PostSharp.Samples.Logging.Console](Diagnostics/PostSharp.Samples.Logging.Console/)                 | Demonstrates how to configure PostSharp Logging so that it directs its output to the *system console*.  | \n| [PostSharp.Samples.Logging.PerRequest](Diagnostics/PostSharp.Samples.Logging.PerRequest/)           | Shows how to have different verbosity for each request, \n| [PostSharp.Samples.Logging.Customization](Diagnostics/PostSharp.Samples.Logging.Customization/)     | Shows how to customize PostSharp Logging.                                                   | \n| [PostSharp.Samples.Logging.Etw](Diagnostics/PostSharp.Samples.Logging.Etw/)                 | Demonstrates how to configure PostSharp Logging so that it directs its output to *ETW*.               | \n| [PostSharp.Samples.Logging.Etw.CustomSource](Diagnostics/PostSharp.Samples.Logging.Etw.CustomSource/)                 | Demonstrates how use PostSharp Logging with a custom *ETW* source (instead of the predefined one).               | \n| [PostSharp.Samples.Logging.Log4Net](Diagnostics/PostSharp.Samples.Logging.Log4Net/)                 | Demonstrates how to configure PostSharp Logging so that it directs its output to *log4net*.   | \n| [PostSharp.Samples.Logging.NLog](Diagnostics/PostSharp.Samples.Logging.NLog/)                 | Demonstrates how to configure PostSharp Logging so that it directs its output to *NLog*.   | \n| [PostSharp.Samples.Logging.Serilog](Diagnostics/PostSharp.Samples.Logging.Serilog/)                 | Demonstrates how to configure PostSharp Logging so that it directs its output to *Serilog*.   | \n| [PostSharp.Samples.Logging.Loupe](Diagnostics/PostSharp.Samples.Logging.Loupe/)                 | Demonstrates how to configure PostSharp Logging so that it directs its output to *Loupe*.   | \n| [PostSharp.Samples.Logging.CommonLogging](Diagnostics/PostSharp.Samples.Logging.CommonLogging/)                 | Demonstrates how to configure PostSharp Logging so that it directs its output to *Common.Logging*.   | \n| [PostSharp.Samples.Logging.CustomBackend.ServiceStack](Diagnostics/PostSharp.Samples.Logging.CustomBackend.ServiceStack/)  | Demonstrates how to implement a PostSharp Logging adapter for your custom logging framework.   | \n| [PostSharp.Samples.Logging.Audit](Diagnostics/PostSharp.Samples.Audit/)  | Shows how to append an audit record to a database when a method is invoked.   |\n| **Distributed Diagnostics with Elastic Search**                 \n| [PostSharp.Samples.Logging.ElasticStack/MicroserviceExample](Diagnostics/PostSharp.Samples.Logging.ElasticStack/MicroserviceExample/)                 |  The server-side service demonstrating correlation of logs of a distributed application with Elastic Search. | \n| [PostSharp.Samples.Logging.ElasticStack/ClientExample](Diagnostics/PostSharp.Samples.Logging.ElasticStack/ClientExample/)                 |  The server-side service demonstrating correlation of logs of a distributed application with Elastic Search.  | \n| **XAML**                 \n| [PostSharp.Samples.Xaml](Xaml/PostSharp.Samples.Xaml/)                                              | Demonstrates a few ready-made aspects that are useful for XAML                               | \n| **Caching**                 \n| [PostSharp.Samples.Caching](Solid/PostSharp.Samples.Caching/)             | Caching method results with Redis and different ways to remove things from the cache. | \n| **Threading**                 \n| [PostSharp.Samples.Threading.PingPong](Threading/PostSharp.Samples.Threading.PingPong/)             | The classic educational ping-pong example.                                                   | \n| [PostSharp.Samples.Threading.ThreadDispatching](Threading/PostSharp.Samples.Threading.ThreadDispatching/) | A simple WPF progress bar updated from a background thread.                            | \n| **Platform Support**                 \n| [PostSharp.Samples.Blazor.AutoRetry](Blazor/PostSharp.Samples.Blazor.AutoRetry/) | Demonstrates a custom aspect used in a Blazor application. |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostsharp%2Fpostsharp.samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostsharp%2Fpostsharp.samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostsharp%2Fpostsharp.samples/lists"}