<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Burak Kepti</title>
    <description>The latest articles on DEV Community by Burak Kepti (@burakkepti).</description>
    <link>https://dev.to/burakkepti</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1875158%2F49c64283-2fb0-419f-9633-c640e4de3124.jpg</url>
      <title>DEV Community: Burak Kepti</title>
      <link>https://dev.to/burakkepti</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/burakkepti"/>
    <language>en</language>
    <item>
      <title>Injecting your interface at runtime with generic types.</title>
      <dc:creator>Burak Kepti</dc:creator>
      <pubDate>Fri, 02 Aug 2024 19:09:11 +0000</pubDate>
      <link>https://dev.to/burakkepti/injecting-your-interface-at-runtime-with-generic-types-424n</link>
      <guid>https://dev.to/burakkepti/injecting-your-interface-at-runtime-with-generic-types-424n</guid>
      <description>&lt;p&gt;In some situations, you need to inject your interface with unknown types. Assume that you have a main T type as a DB which you need to mark as deleted (soft delete) and need to be sure you can do the same operation for child tables. And you have one generic delete Interface for entities. &lt;/p&gt;

&lt;p&gt;How would you call them :&lt;/p&gt;

&lt;p&gt;`// Get your service type generically&lt;br&gt;
Type serviceType = entity.CultureEntity == typeof(IDeleteBusiness&amp;lt;&amp;gt;).MakeGenericType(entity.Type);&lt;/p&gt;

&lt;p&gt;//Get the related service from your startup.cs injection&lt;br&gt;
object service = this.serviceProvider.GetRequiredService(serviceType);&lt;/p&gt;

&lt;p&gt;//Get The method from the injected class&lt;br&gt;
object? result = service&lt;br&gt;
   .GetType()&lt;br&gt;
   .GetMethod("MethodName"), [typeof(List)])?.Invoke(service, [requests]);`&lt;/p&gt;

&lt;p&gt;All you need is to Invoke it after&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to remove duplications on TSQL</title>
      <dc:creator>Burak Kepti</dc:creator>
      <pubDate>Fri, 02 Aug 2024 18:51:06 +0000</pubDate>
      <link>https://dev.to/burakkepti/how-to-remove-duplications-on-tsql-2akh</link>
      <guid>https://dev.to/burakkepti/how-to-remove-duplications-on-tsql-2akh</guid>
      <description>&lt;p&gt;There is always a situation in which we need to remove duplications in our queries. There is an advanced way to do this for multi-purpose purpose usage. Assume that we are importing data from 3rd part source like this.&lt;/p&gt;

&lt;p&gt;`IF OBJECT_ID(N'tempdb..#Product') IS NOT NULL&lt;br&gt;
BEGIN&lt;br&gt;
DROP TABLE #Product&lt;br&gt;
END&lt;br&gt;
create TABLE #Product (Name VARCHAR(100),Description VARCHAR(255));&lt;/p&gt;

&lt;p&gt;INSERT INTO #Product(Name, Description) VALUES ('Entity Framework Extensions', 'Entity Framework Extensions Description.');&lt;br&gt;
INSERT INTO #Product(Name, Description) VALUES ('Dapper Plus', 'Dapper Plus Description.');&lt;br&gt;
INSERT INTO #Product(Name, Description) VALUES ('C# Eval Expression', 'C# Eval Description');&lt;br&gt;
INSERT INTO #Product(Name, Description) VALUES ('Entity Framework Extensions', 'Entity Framework Extensions Description.');&lt;br&gt;
INSERT INTO #Product(Name, Description) VALUES ('Dapper Plus', 'Dapper Plus Description.');&lt;br&gt;
INSERT INTO #Product(Name, Description) VALUES ('C# Eval Expression', 'C# Eval Description');`&lt;/p&gt;

&lt;p&gt;How we do it :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;(SELECT Name ,ROW_NUMBER() over (partition by Name order by Name) RowNumber FROM #Product) a where a.RowNumber = 1;&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
