Integrate your Supabase projects with C#.
Includes C# features to make supabase function more like an ORM - specifically the ability to leverage strongly typed models.
Inspired by and reuse the code from :
- Remove singletons
- Allow better integration with DI
- Use nullable everywhere
- Use System.Text.Json instead of Newtonsoft (except when it's not possible)
- Integration with GoTrue
- Integration with Postgrest
- Integration with Realtime
- Integration with Storage
- Integration with Edge Functions
- Nuget Release
Getting started will be pretty easy, allowing dependencies injection.
Sample usage can be found here : TechMagister/SupaAppTemplate
@TODO
Supabase-client is heavily dependent on Models deriving from BaseModel
). To interact with the API, one must have the associated model specified.
Leverage Table
,PrimaryKey
, and Column
attributes to specify names of classes/properties that are different from
their C# Versions.
[Table("messages")]
public class Message : SupabaseModel
{
// `ShouldInsert` Set to false so-as to honor DB generated key
// If the primary key was set by the application, this could be omitted.
[PrimaryKey("id", false)]
public int Id { get; set; }
[Column("username")]
public string UserName { get; set; }
[Column("channel_id")]
public int ChannelId { get; set; }
}
We are more than happy to have contributions! Please submit a PR.