Exemple #1
0
        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);
        }
Exemple #2
0
 public GenericRepository(ZewwDbContext context)
 {
     this.context = context;
     this.dbSet   = context.Set <TEntity>();
 }
Exemple #3
0
 //This sets the context of the child class to the context of the super class
 public UserWorkspaceRepository(ZewwDbContext context) : base(context)
 {
 }
Exemple #4
0
 public UserChatsRepository(ZewwDbContext context) : base(context)
 {
 }
Exemple #5
0
 //This sets the context of the child class to the context of the super class
 public ChatRepository(ZewwDbContext context) : base(context)
 {
 }
Exemple #6
0
 public EmojiRepository(ZewwDbContext context) : base(context)
 {
 }
Exemple #7
0
 //This sets the context of the child class to the context of the super class
 public FileRepository(ZewwDbContext context) : base(context)
 {
 }
Exemple #8
0
 //This sets the context of the child class to the context of the super class
 public MessageRepository(ZewwDbContext context) : base(context)
 {
 }