Skip to content

Instantly share code, notes, and snippets.

View KarthikMTech's full-sized avatar

KarthikMTech

View GitHub Profile
@davepcallan
davepcallan / ChatGPTAPIExample.cs
Created March 7, 2024 13:02
Simple example of integrating with ChatGPT API from .NET
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System.Text;
using System.Text.Json;
namespace Samples;
public class ChatGPTAPIExample(ILogger<ChatGPTAPIExample> logger, IConfiguration configuration)
{
private string Prompt = "Please explain the following code :";
@LukeWinikates
LukeWinikates / FakeDbSet.cs
Created October 24, 2011 16:31
An implementation of IDbSet to help with mocking Entity Framework DbContexts.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EntityExtensions {
public class FakeDbSet<T> : System.Data.Entity.IDbSet<T> where T : class {
private readonly List<T> list = new List<T>();
public FakeDbSet() {