public UnitOfWork() { DbContextOptionsBuilder <ZewwDbContext> optionsBuilder = new DbContextOptionsBuilder <ZewwDbContext>(); string connection = @"Server=.;Database=ZewwDatabase;Trusted_Connection=True;ConnectRetryCount=0"; optionsBuilder.UseSqlServer(connection); context = new ZewwDbContext(optionsBuilder.Options); Chats = new ChatRepository(context); UserChats = new UserChatsRepository(context); Messages = new MessageRepository(context); Users = new UserRepository(context); UserWorkspaces = new UserWorkspaceRepository(context); Workspaces = new WorkspaceRepository(context); Files = new FileRepository(context); UserChats = new UserChatsRepository(context); Emojis = new EmojiRepository(context); }
public GenericRepository(ZewwDbContext context) { this.context = context; this.dbSet = context.Set <TEntity>(); }
//This sets the context of the child class to the context of the super class public UserWorkspaceRepository(ZewwDbContext context) : base(context) { }
public UserChatsRepository(ZewwDbContext context) : base(context) { }
//This sets the context of the child class to the context of the super class public ChatRepository(ZewwDbContext context) : base(context) { }
public EmojiRepository(ZewwDbContext context) : base(context) { }
//This sets the context of the child class to the context of the super class public FileRepository(ZewwDbContext context) : base(context) { }
//This sets the context of the child class to the context of the super class public MessageRepository(ZewwDbContext context) : base(context) { }