Skip to content

Instantly share code, notes, and snippets.

Avatar

John Ojo JIOO-phoeNIX

View GitHub Profile
View appsettings.json
{
"ConnectionStrings": {
"SampleAppDbContext": "Data Source=DESKTOP-HC36QP0;Initial Catalog=GraphQLSampleApp;Integrated Security=True;"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
View Subscription.cs
using GraphQLSampleApp.DataAccess.Entity;
using HotChocolate;
using HotChocolate.Execution;
using HotChocolate.Subscriptions;
using HotChocolate.Types;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
View Mutation.cs
using GraphQLSampleApp.DataAccess.DAO;
using GraphQLSampleApp.DataAccess.Entity;
using HotChocolate;
using HotChocolate.Subscriptions;
using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
View Query.cs
using GraphQLSampleApp.DataAccess.DAO;
using GraphQLSampleApp.DataAccess.Entity;
using HotChocolate;
using HotChocolate.Subscriptions;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace GraphQLSampleApp.DataAccess
{
public class Query
View EmployeeRepository.cs
using GraphQLSampleApp.DataAccess.Entity;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace GraphQLSampleApp.DataAccess.DAO
{
public class EmployeeRepository
View DepartmentRepository.cs
using GraphQLSampleApp.DataAccess.Entity;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace GraphQLSampleApp.DataAccess.DAO
{
public class DepartmentRepository
View SampleAppDbContext.cs
using Microsoft.EntityFrameworkCore;
namespace GraphQLSampleApp.DataAccess.Entity
{
public class SampleAppDbContext : DbContext
{
public SampleAppDbContext(DbContextOptions<SampleAppDbContext> options) : base(options)
{
}
View Employee.cs
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace GraphQLSampleApp.DataAccess.Entity
{
public class Employee
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
View Department.cs
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace GraphQLSampleApp.DataAccess.Entity
{
public class Department
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
View Startup.cs
using GraphQLSampleApp.DataAccess;
using GraphQLSampleApp.DataAccess.DAO;
using GraphQLSampleApp.DataAccess.Entity;
using HotChocolate;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;