ATAshok Tandanintandan.hashnode.dev·Aug 4, 2023 · 1 min readtransient, scoped, and singleton// IProductCatalogService.cs public interface IProductCatalogService { List GetProducts(); } // IShoppingCartService.cs public interface IShoppingCartService { void AddToCart(Product product); List GetCartItems(); } // IOrderProcessingService.cs publ...00
ATAshok Tandanintandan.hashnode.dev·Jul 10, 2023 · 2 min readvirtual and override keywords in C#If there were no virtual and override keywords in C#, the methods would not be explicitly marked for virtual or overridden behavior, and the default method resolution would be based on the type of the variable at compile-time. In such a scenario, whe...00
ATAshok Tandanintandan.hashnode.dev·Apr 26, 2023 · 2 min readAsp Core custom sessionpublic class CustomSession : ISession { private readonly IDistributedCache cache; private readonly string sessionKey; private readonly string sessionId; private Dictionary<string, byte[]> data; public bool IsAvailable { get; set; } public string Id =...00
ATAshok Tandanintandan.hashnode.dev·Apr 18, 2023 · 1 min readelastic kibana update queryPOST products_dev/_update_by_query { "script" : { "source": "ctx._source.ranking=9999;" }, "query": { "term" : { "ranking": 0 } } } Duplicate find by grouping: GET /operators_circles/_search { "size": 0, "aggs": { "duplicate_documents": { "terms": { ...00
ATAshok Tandanintandan.hashnode.dev·Apr 18, 2023 · 1 min readPass by value vs referencepublic void Foo(Image image) { // This change won't be seen by the caller: it's changing the value // of the parameter. image = Image.FromStream(...); } public void Foo(ref Image image) { // This change will be seen by the caller: it's changing the v...00