Index: src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Authentication/AuthenticationPolicy.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Authentication/AuthenticationPolicy.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Authentication/AuthenticationPolicy.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,7 @@
+﻿namespace FinkiChattery.Api.ApplicationServices.Authentication
+{
+    public static class AuthenticationPolicy
+    {
+        public const string Student = "Student";
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Authentication/CurrentUserIsOfRoleRequirementHandler.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Authentication/CurrentUserIsOfRoleRequirementHandler.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Authentication/CurrentUserIsOfRoleRequirementHandler.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,27 @@
+﻿using FinkiChattery.Common.User;
+using Microsoft.AspNetCore.Authorization;
+using System.Threading.Tasks;
+
+namespace FinkiChattery.Api.ApplicationServices.Authentication
+{
+    public class CurrentUserIsOfRoleRequirementHandler : AuthorizationHandler<CurrentUserIsOfRoleRequirement>
+    {
+        public CurrentUserIsOfRoleRequirementHandler(ICurrentUser currentUser)
+        {
+            CurrentUser = currentUser;
+        }
+
+        public ICurrentUser CurrentUser { get; }
+
+        protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, CurrentUserIsOfRoleRequirement requirement)
+        {
+            if (CurrentUser.Role != requirement.UserRole)
+            {
+                context.Fail();
+            }
+
+            context.Succeed(requirement);
+            return Task.CompletedTask;
+        }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Authentication/Requirements/CurrentUserIsOfRoleRequirement.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Authentication/Requirements/CurrentUserIsOfRoleRequirement.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Authentication/Requirements/CurrentUserIsOfRoleRequirement.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,15 @@
+﻿using FinkiChattery.Common.User;
+using Microsoft.AspNetCore.Authorization;
+
+namespace FinkiChattery.Api.ApplicationServices.Authentication
+{
+    public class CurrentUserIsOfRoleRequirement : IAuthorizationRequirement
+    {
+        public CurrentUserIsOfRoleRequirement(UserRole userRole)
+        {
+            UserRole = userRole;
+        }
+
+        public UserRole UserRole { get; }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Authentication/Requirements/StudentRequirement.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Authentication/Requirements/StudentRequirement.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Authentication/Requirements/StudentRequirement.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,11 @@
+﻿using FinkiChattery.Common.User;
+
+namespace FinkiChattery.Api.ApplicationServices.Authentication
+{
+    public class StudentRequirement : CurrentUserIsOfRoleRequirement
+    {
+        public StudentRequirement() : base(UserRole.Student)
+        {
+        }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Api/Controllers/ApiVersions.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Api/Controllers/ApiVersions.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Api/Controllers/ApiVersions.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,7 @@
+﻿namespace FinkiChattery.Api.Controllers
+{
+    public static class ApiVersions
+    {
+        public const string ApiVersion1 = "1";
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Api/Controllers/v1/QuestionsController.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Api/Controllers/v1/QuestionsController.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Api/Controllers/v1/QuestionsController.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,32 @@
+﻿using FinkiChattery.Api.ApplicationServices.Authentication;
+using FinkiChattery.Commands.Questioning;
+using FinkiChattery.Common.Mediator.Interfaces;
+using FinkiChattery.Contracts.Questioning;
+using IdentityServer4.AccessTokenValidation;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using System.Threading.Tasks;
+
+namespace FinkiChattery.Api.Controllers.v1
+{
+    [ApiVersion(ApiVersions.ApiVersion1)]
+    [Route("api/v{version:apiVersion}/[controller]")]
+    [ApiController]
+    public class QuestionsController : ControllerBase
+    {
+        public QuestionsController(IMediatorService mediatorService)
+        {
+            MediatorService = mediatorService;
+        }
+
+        public IMediatorService MediatorService { get; }
+
+        [HttpPost]
+        [Authorize(AuthenticationSchemes = IdentityServerAuthenticationDefaults.AuthenticationScheme, Policy = AuthenticationPolicy.Student)]
+        public async Task<IActionResult> AskQuestion([FromBody] AskQuestionRequest request)
+        {
+            await MediatorService.SendAsync(new AskQuestionCommand(request.Title, request.Text, request.Categories));
+            return Ok();
+        }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Api/FinkiChattery.Api.csproj
===================================================================
--- src/FinkiChattery/FinkiChattery.Api/FinkiChattery.Api.csproj	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Api/FinkiChattery.Api.csproj	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -13,4 +13,5 @@
     <PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
     <PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
+    <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
     <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.5">
       <PrivateAssets>all</PrivateAssets>
@@ -21,10 +22,8 @@
 
   <ItemGroup>
+    <ProjectReference Include="..\FinkiChattery.Commands\FinkiChattery.Commands.csproj" />
     <ProjectReference Include="..\FinkiChattery.Common\FinkiChattery.Common.csproj" />
+    <ProjectReference Include="..\FinkiChattery.Contracts\FinkiChattery.Contracts.csproj" />
     <ProjectReference Include="..\FinkiChattery.Persistence\FinkiChattery.Persistence.csproj" />
-  </ItemGroup>
-
-  <ItemGroup>
-    <Folder Include="Controllers\" />
   </ItemGroup>
 
Index: src/FinkiChattery/FinkiChattery.Api/Services/RegisterServices.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Api/Services/RegisterServices.cs	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Api/Services/RegisterServices.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -1,3 +1,5 @@
-﻿using FinkiChattery.Api.Services;
+﻿using FinkiChattery.Api.ApplicationServices.Authentication;
+using FinkiChattery.Api.Services;
+using FinkiChattery.Commands.Questioning;
 using FinkiChattery.Common.Mediator;
 using FinkiChattery.Common.Mediator.Interfaces;
@@ -6,8 +8,10 @@
 using FinkiChattery.Persistence.Context;
 using FinkiChattery.Persistence.Models;
+using FinkiChattery.Persistence.Repositories;
 using Hangfire;
 using Hangfire.SqlServer;
 using MediatR;
 using Microsoft.AspNetCore.Authentication.JwtBearer;
+using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Identity;
@@ -25,7 +29,5 @@
             services.AddScoped<IEventService, EventService>();
             services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));
-
-            // TODO: REGISTER MEDIATOR HANDLERS WHEN WE CREATE FIRST COMMAND SMENI SO DOMAIN KLASA
-            services.AddMediatR(typeof(RegisterServices));
+            services.AddMediatR(typeof(AskQuestionCommand));
         }
 
@@ -74,5 +76,11 @@
             });
 
-            services.AddAuthorization();
+            services.AddScoped<IAuthorizationHandler, CurrentUserIsOfRoleRequirementHandler>();
+
+            services.AddAuthorization(options =>
+            {
+                options.AddPolicy(AuthenticationPolicy.Student, policy => policy.Requirements.Add(new StudentRequirement()));
+
+            });
         }
 
@@ -94,4 +102,8 @@
         public static void AddRepos(this IServiceCollection services)
         {
+            services.AddScoped<ICategoriesRepo, CategoriesRepo>();
+            services.AddScoped<ITeamRepo, TeamRepo>();
+            services.AddScoped<IQuestionRepo, QuestionRepo>();
+            services.AddScoped<IStudentRepo, StudentRepo>();
         }
 
Index: src/FinkiChattery/FinkiChattery.Api/Startup.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Api/Startup.cs	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Api/Startup.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -2,5 +2,7 @@
 using FinkiChattery.Api.Server;
 using FinkiChattery.Api.Services;
+using FinkiChattery.Commands.Questioning;
 using FinkiChattery.Persistence.Context;
+using FluentValidation.AspNetCore;
 using Hangfire;
 using Microsoft.AspNetCore.Builder;
@@ -41,7 +43,7 @@
 
             services.AddControllers()
-                .ConfigureApiBehaviorOptions(options => options.InvalidModelStateResponseFactory = context => new BadRequestObjectResult(context.ModelState));
-            // TODO: validators
-            // .AddFluentValidation(fv => fv.RegisterValidatorsFromAssemblyContaining<CreateOrganizerWithOrganizationValidator>());
+                .ConfigureApiBehaviorOptions(options => options.InvalidModelStateResponseFactory = context => new BadRequestObjectResult(context.ModelState))
+                .AddFluentValidation(fv => fv.RegisterValidatorsFromAssemblyContaining<AskQuestionValidator>());
+            services.AddApiVersioning();
 
             services.AddCors(options =>
Index: src/FinkiChattery/FinkiChattery.Commands/FinkiChattery.Commands.csproj
===================================================================
--- src/FinkiChattery/FinkiChattery.Commands/FinkiChattery.Commands.csproj	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Commands/FinkiChattery.Commands.csproj	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -5,3 +5,8 @@
   </PropertyGroup>
 
+  <ItemGroup>
+    <ProjectReference Include="..\FinkiChattery.Common\FinkiChattery.Common.csproj" />
+    <ProjectReference Include="..\FinkiChattery.Persistence\FinkiChattery.Persistence.csproj" />
+  </ItemGroup>
+
 </Project>
Index: src/FinkiChattery/FinkiChattery.Commands/Questioning/AskQuestion/AskQuestionCommand.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Commands/Questioning/AskQuestion/AskQuestionCommand.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Commands/Questioning/AskQuestion/AskQuestionCommand.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,67 @@
+﻿using FinkiChattery.Common.Mediator.Contracs;
+using FinkiChattery.Common.User;
+using FinkiChattery.Persistence.Context;
+using FinkiChattery.Persistence.Models;
+using FinkiChattery.Persistence.Repositories;
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace FinkiChattery.Commands.Questioning
+{
+    public class AskQuestionCommand : ICommand<Guid>
+    {
+        public AskQuestionCommand(string title, string text, IEnumerable<Guid> categories)
+        {
+            Title = title;
+            Text = text;
+            Categories = categories;
+        }
+
+        public string Title { get; }
+        public string Text { get; }
+        public IEnumerable<Guid> Categories { get; }
+    }
+
+    public class AskQuestionHandler : ICommandHandler<AskQuestionCommand, Guid>
+    {
+        public AskQuestionHandler(ApplicationDbContext dbContext, ICategoriesRepo categoriesRepo, IStudentRepo studentRepo, ICurrentUser currentUser)
+        {
+            DbContext = dbContext;
+            CategoriesRepo = categoriesRepo;
+            StudentRepo = studentRepo;
+            CurrentUser = currentUser;
+        }
+
+        public ApplicationDbContext DbContext { get; }
+        public ICategoriesRepo CategoriesRepo { get; }
+        public IStudentRepo StudentRepo { get; }
+        public ICurrentUser CurrentUser { get; }
+
+        public async Task<Guid> Handle(AskQuestionCommand request, CancellationToken cancellationToken)
+        {
+            var questionCategories = await CategoriesRepo.GetCategories(request.Categories);
+            var currentStudent = await StudentRepo.GetStudent(CurrentUser.Id);
+
+            var questionDatabaseEntity = new Question()
+            {
+                Title = request.Title,
+                Text = request.Text,
+                StudentFk = currentStudent.Id,
+            };
+
+            foreach (var item in questionCategories)
+            {
+                questionDatabaseEntity.QuestionCategories.Add(new QuestionCategory()
+                {
+                    CategoryFk = item.Id
+                });
+            }
+
+            DbContext.Questions.Add(questionDatabaseEntity);
+            await DbContext.SaveChangesAsync();
+            return questionDatabaseEntity.Uid;
+        }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Commands/Questioning/AskQuestion/AskQuestionValidator.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Commands/Questioning/AskQuestion/AskQuestionValidator.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Commands/Questioning/AskQuestion/AskQuestionValidator.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,16 @@
+﻿using FinkiChattery.Commands.Questioning.Validators;
+using FinkiChattery.Persistence.Repositories;
+using FluentValidation;
+
+namespace FinkiChattery.Commands.Questioning
+{
+    public class AskQuestionValidator : AbstractValidator<AskQuestionCommand>
+    {
+        public AskQuestionValidator(ICategoriesRepo categoriesRepo)
+        {
+            RuleFor(x => x.Title).QuestionTitleValidate();
+            RuleFor(x => x.Text).QuestionTextValidate();
+            RuleFor(x => x.Categories).Cascade(CascadeMode.Stop).ListNotNull().SetValidator(new CategoriesUidsExist(categoriesRepo));
+        }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Commands/Questioning/QuestioningErrorCodes.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Commands/Questioning/QuestioningErrorCodes.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Commands/Questioning/QuestioningErrorCodes.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,12 @@
+﻿using FinkiChattery.Common.Errors;
+
+namespace FinkiChattery.Commands.Questioning
+{
+    public class QuestioningErrorCodes : ErrorCodes
+    {
+        public const string QuestionTitleLengthInvalid = "QuestionTitleLengthInvalid";
+        public const string QuestionTextLengthInvalid = "QuestionTextLengthInvalid";
+        public const string CategoriesDontExist = "CategoriesDontExist";
+        public const string TeamDontExist = "TeamDontExist";
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Commands/Questioning/Validators/CategoriesUidsExist.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Commands/Questioning/Validators/CategoriesUidsExist.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Commands/Questioning/Validators/CategoriesUidsExist.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,31 @@
+﻿using FinkiChattery.Persistence.Repositories;
+using FluentValidation.Validators;
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace FinkiChattery.Commands.Questioning.Validators
+{
+    public class CategoriesUidsExist : AsyncValidatorBase
+    {
+        public CategoriesUidsExist(ICategoriesRepo categoriesRepo)
+        {
+            CategoriesRepo = categoriesRepo;
+        }
+
+        public ICategoriesRepo CategoriesRepo { get; }
+
+        protected override async Task<bool> IsValidAsync(PropertyValidatorContext context, CancellationToken cancellation)
+        {
+            var categoriesUids = (IEnumerable<Guid>)context.PropertyValue;
+
+            return await CategoriesRepo.CategoriesExist(categoriesUids);
+        }
+
+        protected override string GetDefaultMessageTemplate()
+        {
+            return QuestioningErrorCodes.CategoriesDontExist;
+        }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Commands/Questioning/Validators/QuestioningFluentValidationRules.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Commands/Questioning/Validators/QuestioningFluentValidationRules.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Commands/Questioning/Validators/QuestioningFluentValidationRules.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,23 @@
+﻿using FluentValidation;
+using System.Collections.Generic;
+
+namespace FinkiChattery.Commands.Questioning.Validators
+{
+    public static class QuestioningFluentValidationRules
+    {
+        public static IRuleBuilderOptions<T, string> QuestionTitleValidate<T>(this IRuleBuilder<T, string> ruleBuilder)
+        {
+            return ruleBuilder.NotNull().WithMessage(QuestioningErrorCodes.CantBeNull).MaximumLength(500).WithMessage(QuestioningErrorCodes.QuestionTitleLengthInvalid);
+        }
+
+        public static IRuleBuilderOptions<T, string> QuestionTextValidate<T>(this IRuleBuilder<T, string> ruleBuilder)
+        {
+            return ruleBuilder.NotNull().WithMessage(QuestioningErrorCodes.CantBeNull).MaximumLength(4000).WithMessage(QuestioningErrorCodes.QuestionTextLengthInvalid);
+        }
+
+        public static IRuleBuilderOptions<T, IEnumerable<U>> ListNotNull<T, U>(this IRuleBuilder<T, IEnumerable<U>> ruleBuilder)
+        {
+            return ruleBuilder.NotNull().WithMessage(QuestioningErrorCodes.CantBeNull);
+        }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Commands/Questioning/Validators/TeamWithUidExist.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Commands/Questioning/Validators/TeamWithUidExist.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Commands/Questioning/Validators/TeamWithUidExist.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,29 @@
+﻿using FinkiChattery.Persistence.Repositories;
+using FluentValidation.Validators;
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace FinkiChattery.Commands.Questioning.Validators
+{
+    public class TeamWithUidExist : AsyncValidatorBase
+    {
+        public TeamWithUidExist(ITeamRepo teamRepo)
+        {
+            TeamRepo = teamRepo;
+        }
+
+        public ITeamRepo TeamRepo { get; }
+
+        protected override async Task<bool> IsValidAsync(PropertyValidatorContext context, CancellationToken cancellation)
+        {
+            var teamUid = (Guid)context.PropertyValue;
+            return await TeamRepo.TeamWithUidExists(teamUid);        
+        }
+
+        protected override string GetDefaultMessageTemplate()
+        {
+            return QuestioningErrorCodes.TeamDontExist;
+        }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Common/Errors/ErrorCodes.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Common/Errors/ErrorCodes.cs	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Common/Errors/ErrorCodes.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -1,6 +1,7 @@
 ﻿namespace FinkiChattery.Common.Errors
 {
-    public static class ErrorCodes
+    public class ErrorCodes
     {
+        public const string CantBeNull = "CantBeNull";
     }
 }
Index: src/FinkiChattery/FinkiChattery.Contracts/Questioning/AskQuestion/AskQuestionRequest.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Contracts/Questioning/AskQuestion/AskQuestionRequest.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Contracts/Questioning/AskQuestion/AskQuestionRequest.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,14 @@
+﻿using System;
+using System.Collections.Generic;
+
+namespace FinkiChattery.Contracts.Questioning
+{
+    public class AskQuestionRequest
+    {
+        public string Title { get; set; }
+
+        public string Text { get; set; }
+
+        public IEnumerable<Guid> Categories { get; set; }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Database/FinkiChattery.Database.sqlproj
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/FinkiChattery.Database.sqlproj	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Database/FinkiChattery.Database.sqlproj	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -66,10 +66,10 @@
     <Folder Include="dbo\Tables\User" />
     <Folder Include="dbo\Tables\User\Seed" />
+    <Folder Include="dbo\Tables\Category" />
+    <Folder Include="dbo\Tables\Team" />
+    <Folder Include="dbo\Tables\Student" />
   </ItemGroup>
   <ItemGroup>
-    <Build Include="dbo\Tables\Category.sql" />
-    <Build Include="dbo\Tables\Team.sql" />
     <Build Include="dbo\Tables\Moderator.sql" />
-    <Build Include="dbo\Tables\Student.sql" />
     <Build Include="dbo\Tables\Teacher.sql" />
     <Build Include="dbo\Tables\Question.sql" />
@@ -83,4 +83,9 @@
     <Build Include="dbo\Tables\User\AspNetRoles.sql" />
     <None Include="dbo\Tables\User\Seed\Users.Debug.Seed.sql" />
+    <Build Include="dbo\Tables\Category\Category.sql" />
+    <None Include="dbo\Tables\Category\Category.Seed.sql" />
+    <Build Include="dbo\Tables\Team\Team.sql" />
+    <Build Include="dbo\Tables\Student\Student.sql" />
+    <None Include="dbo\Tables\Student\Student.Debug.Seed.sql" />
   </ItemGroup>
   <ItemGroup>
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Scripts/PostDeploymentScripts/Debug.PostDeployment.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Scripts/PostDeploymentScripts/Debug.PostDeployment.sql	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Database/dbo/Scripts/PostDeploymentScripts/Debug.PostDeployment.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -1,1 +1,3 @@
 ﻿:r .\..\..\Tables\User\Seed\Users.Debug.Seed.sql
+:r .\..\..\Tables\Category\Category.Seed.sql
+:r .\..\..\Tables\Student\Student.Debug.Seed.sql
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Scripts/PostDeploymentScripts/Production.PostDeployment.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Scripts/PostDeploymentScripts/Production.PostDeployment.sql	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Database/dbo/Scripts/PostDeploymentScripts/Production.PostDeployment.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -1,1 +1,1 @@
-﻿
+﻿:r .\..\..\Tables\Category\Category.Seed.sql
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Answer.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Answer.sql	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Answer.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -2,5 +2,5 @@
     [Id]            BIGINT           IDENTITY (1, 1) NOT NULL,
     [Uid]           UNIQUEIDENTIFIER NOT NULL,
-    [Text]          NVARCHAR (1)     NOT NULL,
+    [Text]          NVARCHAR (4000)  NOT NULL,
     [QuestionFk]    BIGINT           NOT NULL,
     [StudentFk]     BIGINT           NOT NULL,
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Tables/AnswerResponse.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Tables/AnswerResponse.sql	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Database/dbo/Tables/AnswerResponse.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -2,5 +2,5 @@
     [Id]        BIGINT           IDENTITY (1, 1) NOT NULL,
     [Uid]       UNIQUEIDENTIFIER NOT NULL,
-    [Text]      NVARCHAR (1)     NOT NULL,
+    [Text]      NVARCHAR (4000)  NOT NULL,
     [AnswerFk]  BIGINT           NOT NULL,
     [StudentFk] BIGINT           NOT NULL,
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Category.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Category.sql	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ 	(revision )
@@ -1,7 +1,0 @@
-﻿CREATE TABLE [dbo].[Category] (
-    [Id]   BIGINT           IDENTITY (1, 1) NOT NULL,
-    [Uid]  UNIQUEIDENTIFIER NOT NULL,
-    [Name] NVARCHAR (1)     NOT NULL,
-    CONSTRAINT [PK_Category] PRIMARY KEY CLUSTERED ([Id] ASC)
-);
-
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Category/Category.Seed.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Category/Category.Seed.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Category/Category.Seed.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,26 @@
+﻿BEGIN
+SET IDENTITY_INSERT [dbo].[Category] ON
+MERGE [dbo].[Category] AS T
+USING
+(
+	SELECT *
+	FROM (
+	VALUES
+		(1, N'aee193c3-9d36-4ed8-81b2-15eb4ff305f1',  N'internet-techologies'),
+		(2, N'7d19a33f-d4a9-4498-8beb-07a5ce75d638',  N'software-engineering'),
+		(3, N'8317013c-7eb8-4ca9-83c5-0342895e4061',  N'visual-programming'),
+		(4, N'a4493d42-e01f-4092-a700-47a0847c8c4e',  N'operating-systems')
+		)
+		AS temp ([ID], [Uid], [Name])
+) AS S
+ON T.[ID] = S.[ID]
+WHEN MATCHED THEN UPDATE SET
+	  T.[Uid]						= S.[Uid],
+	  T.[Name]						= S.[Name]
+WHEN NOT MATCHED THEN
+INSERT
+([ID], [Uid], [Name])
+VALUES
+(S.[ID], S.[Uid], S.[Name]);
+SET IDENTITY_INSERT [dbo].[Category] OFF
+END
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Category/Category.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Category/Category.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Category/Category.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,7 @@
+﻿CREATE TABLE [dbo].[Category] (
+    [Id]   BIGINT           IDENTITY (1, 1) NOT NULL,
+    [Uid]  UNIQUEIDENTIFIER NOT NULL,
+    [Name] NVARCHAR (500)     NOT NULL,
+    CONSTRAINT [PK_Category] PRIMARY KEY CLUSTERED ([Id] ASC)
+);
+
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Question.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Question.sql	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Question.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -2,5 +2,5 @@
     [Id]           BIGINT           IDENTITY (1, 1) NOT NULL,
     [Uid]          UNIQUEIDENTIFIER NOT NULL,
-    [Title]        NVARCHAR (1)     NOT NULL,
+    [Title]        NVARCHAR (500)     NOT NULL,
     [Text]         NVARCHAR (MAX)   NULL,
     [StudentFk]    BIGINT           NOT NULL,
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Student.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Student.sql	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ 	(revision )
@@ -1,17 +1,0 @@
-﻿CREATE TABLE [dbo].[Student] (
-    [Id]                BIGINT           IDENTITY (1, 1) NOT NULL,
-    [Uid]               UNIQUEIDENTIFIER NOT NULL,
-    [ApplicationUserFk] BIGINT           NOT NULL,
-    [IndexNumber]       NVARCHAR (1)     NOT NULL,
-    [Reputation]        BIGINT           DEFAULT (CONVERT([bigint],(0))) NOT NULL,
-    [ReportReputation]  BIGINT           DEFAULT (CONVERT([bigint],(0))) NOT NULL,
-    [ImageUrl]          NVARCHAR (1)     NOT NULL,
-    CONSTRAINT [PK_Student] PRIMARY KEY CLUSTERED ([Id] ASC),
-    CONSTRAINT [FK_Student_AspNetUsers_ApplicationUserFk] FOREIGN KEY ([ApplicationUserFk]) REFERENCES [dbo].[AspNetUsers] ([Id])
-);
-
-
-GO
-CREATE UNIQUE NONCLUSTERED INDEX [IX_Student_ApplicationUserFk]
-    ON [dbo].[Student]([ApplicationUserFk] ASC);
-
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Student/Student.Debug.Seed.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Student/Student.Debug.Seed.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Student/Student.Debug.Seed.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,27 @@
+﻿BEGIN
+SET IDENTITY_INSERT [dbo].[Student] ON
+MERGE [dbo].[Student] AS T
+USING
+(
+	SELECT *
+	FROM (
+	VALUES
+		(1, N'aee193c3-9d36-4ed8-81b2-15eb4ff305f1', 1, N'193245', 0, 0, N'https://www.pixsy.com/wp-content/uploads/2021/04/ben-sweet-2LowviVHZ-E-unsplash-1.jpeg')
+		)
+		AS temp ([ID], [Uid], [ApplicationUserFk], [IndexNumber], [Reputation], [ReportReputation], [ImageUrl])
+) AS S
+ON T.[ID] = S.[ID]
+WHEN MATCHED THEN UPDATE SET
+	  T.[Uid]						= S.[Uid],
+	  T.[ApplicationUserFk]			= S.[ApplicationUserFk],
+	  T.[IndexNumber]				= S.[IndexNumber],
+	  T.[Reputation]				= S.[Reputation],
+	  T.[ReportReputation]			= S.[ReportReputation],
+	  T.[ImageUrl]					= S.[ImageUrl]
+WHEN NOT MATCHED THEN
+INSERT
+([ID], [Uid], [ApplicationUserFk], [IndexNumber], [Reputation], [ReportReputation], [ImageUrl])
+VALUES
+(S.[ID], S.[Uid], S.[ApplicationUserFk], S.[IndexNumber], S.[Reputation], S.[ReportReputation], S.[ImageUrl]);
+SET IDENTITY_INSERT [dbo].[Student] OFF
+END
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Student/Student.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Student/Student.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Student/Student.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,17 @@
+﻿CREATE TABLE [dbo].[Student] (
+    [Id]                BIGINT           IDENTITY (1, 1) NOT NULL,
+    [Uid]               UNIQUEIDENTIFIER NOT NULL,
+    [ApplicationUserFk] BIGINT           NOT NULL,
+    [IndexNumber]       NVARCHAR (50)     NOT NULL,
+    [Reputation]        BIGINT           DEFAULT (CONVERT([bigint],(0))) NOT NULL,
+    [ReportReputation]  BIGINT           DEFAULT (CONVERT([bigint],(0))) NOT NULL,
+    [ImageUrl]          NVARCHAR (1000)     NOT NULL,
+    CONSTRAINT [PK_Student] PRIMARY KEY CLUSTERED ([Id] ASC),
+    CONSTRAINT [FK_Student_AspNetUsers_ApplicationUserFk] FOREIGN KEY ([ApplicationUserFk]) REFERENCES [dbo].[AspNetUsers] ([Id])
+);
+
+
+GO
+CREATE UNIQUE NONCLUSTERED INDEX [IX_Student_ApplicationUserFk]
+    ON [dbo].[Student]([ApplicationUserFk] ASC);
+
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Team.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Team.sql	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ 	(revision )
@@ -1,8 +1,0 @@
-﻿CREATE TABLE [dbo].[Team] (
-    [Id]          BIGINT           IDENTITY (1, 1) NOT NULL,
-    [Uid]         UNIQUEIDENTIFIER NOT NULL,
-    [Name]        NVARCHAR (1)     NOT NULL,
-    [Description] NVARCHAR (1)     NOT NULL,
-    CONSTRAINT [PK_Team] PRIMARY KEY CLUSTERED ([Id] ASC)
-);
-
Index: src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Team/Team.sql
===================================================================
--- src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Team/Team.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Team/Team.sql	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,8 @@
+﻿CREATE TABLE [dbo].[Team] (
+    [Id]          BIGINT           IDENTITY (1, 1) NOT NULL,
+    [Uid]         UNIQUEIDENTIFIER NOT NULL,
+    [Name]        NVARCHAR (1)     NOT NULL,
+    [Description] NVARCHAR (1)     NOT NULL,
+    CONSTRAINT [PK_Team] PRIMARY KEY CLUSTERED ([Id] ASC)
+);
+
Index: src/FinkiChattery/FinkiChattery.Persistence/Configurations/QuestionConfig.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Configurations/QuestionConfig.cs	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Persistence/Configurations/QuestionConfig.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -1,10 +1,5 @@
-﻿using Microsoft.EntityFrameworkCore;
+﻿using FinkiChattery.Persistence.Models;
+using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Metadata.Builders;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using FinkiChattery.Persistence.Models;
 
 namespace FinkiChattery.Persistence.Configurations
@@ -23,5 +18,5 @@
 
             builder.Property(x => x.Title).HasColumnName(@"Title").HasColumnType("nvarchar").IsRequired().HasMaxLength(500);
-            builder.Property(x => x.TeamFk).HasColumnName(@"Team").HasColumnType("nvarchar").IsRequired().HasMaxLength(4000);
+            builder.Property(x => x.Text).HasColumnName(@"Text").HasColumnType("nvarchar").IsRequired().HasMaxLength(4000);
             builder.Property(x => x.StudentFk).HasColumnName(@"StudentFk").HasColumnType("bigint").IsRequired();
             builder.Property(x => x.CreatedOn).HasColumnName(@"CreatedOn").HasColumnType("smalldatetime").IsRequired();
Index: src/FinkiChattery/FinkiChattery.Persistence/Models/Answer.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Models/Answer.cs	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Persistence/Models/Answer.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -20,7 +20,7 @@
         public DateTime CreatedOn { get; set; }
 
-        public virtual IEnumerable<Upvote> Upvotes { get; set; }
+        public virtual ICollection<Upvote> Upvotes { get; set; }
 
-        public virtual IEnumerable<AnswerResponse> AnswerResponses { get; set; }
+        public virtual ICollection<AnswerResponse> AnswerResponses { get; set; }
 
     }
Index: src/FinkiChattery/FinkiChattery.Persistence/Models/Base/BaseEntity.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Models/Base/BaseEntity.cs	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Persistence/Models/Base/BaseEntity.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -1,7 +1,3 @@
 ﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace FinkiChattery.Persistence.Models
@@ -9,4 +5,9 @@
     public class BaseEntity
     {
+        public BaseEntity()
+        {
+            Uid = Guid.NewGuid();
+        }
+
         public long Id { get; set; }
 
Index: src/FinkiChattery/FinkiChattery.Persistence/Models/Question.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Models/Question.cs	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Persistence/Models/Question.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -6,4 +6,12 @@
     public class Question : BaseEntity
     {
+        public Question() : base()
+        {
+            CreatedOn = DateTime.UtcNow;
+            LastActiveOn = DateTime.UtcNow;
+            Answers = new List<Answer>();
+            QuestionCategories = new List<QuestionCategory>();
+        }
+
         public string Title { get; set; }
 
@@ -24,7 +32,7 @@
         public DateTime LastActiveOn { get; set; }
 
-        public virtual IEnumerable<Answer> Answers { get; set; }
+        public virtual ICollection<Answer> Answers { get; set; }
 
-        public virtual IEnumerable<QuestionCategory> QuestionCategories { get; set; }
+        public virtual ICollection<QuestionCategory> QuestionCategories { get; set; }
 
         // TODO: Pole po koe ke pravime queries
Index: src/FinkiChattery/FinkiChattery.Persistence/Models/QuestionCategory.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Models/QuestionCategory.cs	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Persistence/Models/QuestionCategory.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -9,4 +9,8 @@
     public class QuestionCategory : BaseEntity
     {
+        public QuestionCategory() : base()
+        {
+        }
+
         public long QuestionFk { get; set; }
 
Index: src/FinkiChattery/FinkiChattery.Persistence/Models/Student.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Models/Student.cs	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Persistence/Models/Student.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -21,9 +21,9 @@
         public string ImageUrl { get; set; }
 
-        public virtual IEnumerable<Question> Questions { get; set; }
+        public virtual ICollection<Question> Questions { get; set; }
         
-        public virtual IEnumerable<Answer> Answers { get; set; }
+        public virtual ICollection<Answer> Answers { get; set; }
         
-        public virtual IEnumerable<StudentTeam> StudentTeams { get; set; }
+        public virtual ICollection<StudentTeam> StudentTeams { get; set; }
     }
 }
Index: src/FinkiChattery/FinkiChattery.Persistence/Models/Teacher.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Models/Teacher.cs	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Persistence/Models/Teacher.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -13,5 +13,5 @@
         public virtual ApplicationUser ApplicationUser { get; set; }
 
-        public virtual IEnumerable<TeacherTeam> TeacherTeams { get; set; }
+        public virtual ICollection<TeacherTeam> TeacherTeams { get; set; }
 
     }
Index: src/FinkiChattery/FinkiChattery.Persistence/Models/Team.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Models/Team.cs	(revision cabaa79de64c435cca182591a51b950441985e75)
+++ src/FinkiChattery/FinkiChattery.Persistence/Models/Team.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -13,9 +13,9 @@
         public string Description { get; set; }
 
-        public virtual IEnumerable<Question> Questions{ get; set; }
+        public virtual ICollection<Question> Questions{ get; set; }
 
-        public virtual IEnumerable<StudentTeam> TeamStudents { get; set; }
+        public virtual ICollection<StudentTeam> TeamStudents { get; set; }
 
-        public virtual IEnumerable<TeacherTeam> TeamTeachers { get; set; }
+        public virtual ICollection<TeacherTeam> TeamTeachers { get; set; }
     }
 }
Index: src/FinkiChattery/FinkiChattery.Persistence/Repositories/Base/Repository.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Repositories/Base/Repository.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Persistence/Repositories/Base/Repository.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,41 @@
+﻿using FinkiChattery.Persistence.Context;
+using FinkiChattery.Persistence.Models;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace FinkiChattery.Persistence.Repositories
+{
+    public abstract class Repository<T> where T : BaseEntity
+    {
+        public Repository(ApplicationDbContext dbContext)
+        {
+            DbContext = dbContext;
+            DbSet = DbContext.Set<T>();
+        }
+
+        protected ApplicationDbContext DbContext { get; }
+        protected DbSet<T> DbSet { get; }
+
+        public IQueryable<T> All()
+        {
+            return DbSet.AsQueryable();
+        }
+
+        public async Task<T> GetByIdAsync(int id)
+        {
+            return await All().FirstOrDefaultAsync(f => f.Id == id);
+        }
+
+        public void Add(T entity)
+        {
+            DbSet.Add(entity);
+        }
+
+        public async Task<T> GetByUidAsync(Guid uid)
+        {
+            return await All().FirstOrDefaultAsync(f => f.Uid == uid);
+        }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/ICategoriesRepo.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/ICategoriesRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/ICategoriesRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,16 @@
+﻿using FinkiChattery.Persistence.Models;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FinkiChattery.Persistence.Repositories
+{
+    public interface ICategoriesRepo
+    {
+        public Task<bool> CategoriesExist(IEnumerable<Guid> categoriesUids);
+
+        public Task<IEnumerable<Category>> GetCategories(IEnumerable<Guid> categoriesUids);
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/IQuestionRepo.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/IQuestionRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/IQuestionRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,6 @@
+﻿namespace FinkiChattery.Persistence.Repositories
+{
+    public interface IQuestionRepo
+    {
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/IStudentRepo.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/IStudentRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/IStudentRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,10 @@
+﻿using FinkiChattery.Persistence.Models;
+using System.Threading.Tasks;
+
+namespace FinkiChattery.Persistence.Repositories
+{
+    public interface IStudentRepo
+    {
+        public Task<Student> GetStudent(long applicationUserFk);
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/ITeamRepo.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/ITeamRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/ITeamRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,10 @@
+﻿using System;
+using System.Threading.Tasks;
+
+namespace FinkiChattery.Persistence.Repositories
+{
+    public interface ITeamRepo
+    {
+        public Task<bool> TeamWithUidExists(Guid teamUid);
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/CategoriesRepo.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/CategoriesRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/CategoriesRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,27 @@
+﻿using FinkiChattery.Persistence.Context;
+using FinkiChattery.Persistence.Models;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace FinkiChattery.Persistence.Repositories
+{
+    public class CategoriesRepo : Repository<Category>, ICategoriesRepo
+    {
+        public CategoriesRepo(ApplicationDbContext dbContext) : base(dbContext)
+        {
+        }
+
+        public async Task<bool> CategoriesExist(IEnumerable<Guid> categoriesUids)
+        {
+            return await DbSet.Where(x => categoriesUids.Contains(x.Uid)).CountAsync() == categoriesUids.Count();
+        }
+
+        public async Task<IEnumerable<Category>> GetCategories(IEnumerable<Guid> categoriesUids)
+        {
+            return await DbSet.Where(x => categoriesUids.Contains(x.Uid)).ToListAsync();
+        }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/QuestionRepo.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/QuestionRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/QuestionRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,12 @@
+﻿using FinkiChattery.Persistence.Context;
+using FinkiChattery.Persistence.Models;
+
+namespace FinkiChattery.Persistence.Repositories
+{
+    public class QuestionRepo : Repository<Question>, IQuestionRepo
+    {
+        public QuestionRepo(ApplicationDbContext dbContext) : base(dbContext)
+        {
+        }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/StudentRepo.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/StudentRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/StudentRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,19 @@
+﻿using FinkiChattery.Persistence.Context;
+using FinkiChattery.Persistence.Models;
+using Microsoft.EntityFrameworkCore;
+using System.Threading.Tasks;
+
+namespace FinkiChattery.Persistence.Repositories
+{
+    public class StudentRepo : Repository<Student>, IStudentRepo
+    {
+        public StudentRepo(ApplicationDbContext dbContext) : base(dbContext)
+        {
+        }
+
+        public async Task<Student> GetStudent(long applicationUserFk)
+        {
+            return await DbSet.FirstOrDefaultAsync(x => x.ApplicationUserFk == applicationUserFk);
+        }
+    }
+}
Index: src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/TeamRepo.cs
===================================================================
--- src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/TeamRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
+++ src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/TeamRepo.cs	(revision 7146ebb2db66bf2d2437fe44c758e82313ba6278)
@@ -0,0 +1,20 @@
+﻿using FinkiChattery.Persistence.Context;
+using FinkiChattery.Persistence.Models;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Threading.Tasks;
+
+namespace FinkiChattery.Persistence.Repositories
+{
+    public class TeamRepo : Repository<Team>, ITeamRepo
+    {
+        public TeamRepo(ApplicationDbContext dbContext) : base(dbContext)
+        {
+        }
+
+        public async Task<bool> TeamWithUidExists(Guid teamUid)
+        {
+            return await DbSet.AnyAsync(x => x.Uid == teamUid);
+        }
+    }
+}
