Skip to content

Instantly share code, notes, and snippets.

View Patrick-Ullrich's full-sized avatar

Patrick Ullrich Patrick-Ullrich

View GitHub Profile
@Patrick-Ullrich
Patrick-Ullrich / FormControl
Created February 13, 2021 02:24
Chakra UI Typescript Formik
import {
FormControl as ChakraFormControl,
FormControlProps as ChakraFormControlProps,
FormErrorMessage,
Text,
FormLabel,
FormLabelProps,
} from '@chakra-ui/react';
import React, { ReactNode } from 'react';
@Patrick-Ullrich
Patrick-Ullrich / StreamingContext.cs
Created November 25, 2020 02:07
DbContext w/ M2M
public class StreamingContext : DbContext
{
public StreamingContext(DbContextOptions<StreamingContext> options) : base(options) { }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Streamer>()
.HasMany(s => s.Subscribers)
.WithMany(s => s.Streamers)
.UsingEntity<Subscription>(
@Patrick-Ullrich
Patrick-Ullrich / Entities.cs
Last active November 25, 2020 04:42
M2M-EF-Entities-Old
public class Subscriber
{
public int Id { get; set; }
public string Name { get; set; }
public int Age { get; set; }
public ICollection<Subscription> Subscriptions { get; set; }
}
public class Streamer
{